/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --navy: #0F172A;
  --slate-900: #0B0E14;
  --slate-800: #1E293B;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-300: #CBD5E1;
  --slate-100: #F1F5F9;
  --off-white: #F8FAFC;
  --sky: #38BDF8;
  --cyan: #22D3EE;
  --teal: #4FD1C5;
  --orange: #F97316;
  --brass: #C9A24B;
  --amber: #F59E0B;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--slate-900);
  color: var(--off-white);
  line-height: 1.6;
  min-height: 100vh;
}

.dashboard-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部导航栏 */
.top-nav {
  background: var(--navy);
  border-bottom: 1px solid var(--slate-700);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--off-white);
  margin-bottom: 2px;
}

.nav-subtitle {
  font-size: 0.75rem;
  color: var(--slate-300);
  font-weight: 400;
}

.nav-menu {
  display: flex;
  gap: 0.5rem;
  list-style: none;
}

.nav-link {
  display: block;
  padding: 0.625rem 1rem;
  color: var(--slate-300);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--off-white);
  background: rgba(56, 189, 248, 0.08);
}

.nav-link.active {
  color: var(--sky);
  background: rgba(56, 189, 248, 0.12);
}

/* 主内容区 */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.page-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page-section.active {
  display: block;
}

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

.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--off-white);
  margin-bottom: 0.5rem;
}

.page-desc {
  font-size: 0.9375rem;
  color: var(--slate-300);
}

/* 统计卡片网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--navy);
  border: 1px solid var(--slate-700);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s;
}

.stat-card:hover {
  border-color: var(--sky);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.stat-icon {
  font-size: 2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 10px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--sky);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--slate-300);
}

/* 章节标题 */
.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--off-white);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--slate-700);
}

/* 架构图 */
.architecture-section {
  background: var(--navy);
  border: 1px solid var(--slate-700);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2.5rem;
}

.architecture-diagram {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.architecture-column {
  background: var(--slate-800);
  border: 1px solid var(--slate-700);
  border-radius: 8px;
  overflow: hidden;
}

.arch-header {
  background: linear-gradient(135deg, var(--sky) 0%, var(--cyan) 100%);
  color: var(--navy);
  font-weight: 600;
  font-size: 1rem;
  padding: 1rem;
  text-align: center;
}

.arch-items {
  padding: 1rem;
}

.arch-item {
  background: var(--navy);
  border: 1px solid var(--slate-700);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--off-white);
  transition: all 0.2s;
}

.arch-item:last-child {
  margin-bottom: 0;
}

.arch-item:hover {
  border-color: var(--sky);
  transform: translateX(4px);
}

.arch-item.special {
  border-color: var(--orange);
  background: rgba(249, 115, 22, 0.05);
}

/* 业务条线 */
.business-lines-section {
  background: var(--navy);
  border: 1px solid var(--slate-700);
  border-radius: 12px;
  padding: 2rem;
}

.business-lines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.business-line-card {
  background: var(--slate-800);
  border: 1px solid var(--slate-700);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s;
}

.business-line-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.bl-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}

.bl-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--off-white);
  margin-bottom: 0.25rem;
}

.bl-desc {
  font-size: 0.8125rem;
  color: var(--slate-300);
  line-height: 1.4;
}

/* 占位符样式 */
.placeholder-section {
  background: var(--navy);
  border: 1px solid var(--slate-700);
  border-radius: 12px;
  padding: 4rem 2rem;
  text-align: center;
}

.placeholder-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.placeholder-section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--off-white);
  margin-bottom: 0.75rem;
}

.placeholder-section p {
  font-size: 0.9375rem;
  color: var(--slate-300);
  margin-bottom: 0.5rem;
}

.placeholder-note {
  color: var(--sky);
  font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .top-nav {
    flex-direction: column;
    height: auto;
    padding: 1rem;
    gap: 1rem;
  }

  .nav-menu {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .main-content {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .architecture-diagram {
    grid-template-columns: 1fr;
  }

  .business-lines-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* 订单明细面板 */
.order-details-panel {
  margin-top: 1rem;
}

.order-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.order-metric-card {
  background: var(--slate-800);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--slate-700);
}

.order-metric-label {
  font-size: 0.875rem;
  color: var(--slate-300);
  margin-bottom: 0.5rem;
}

.order-metric-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--sky);
}

/* 分布条 */
.distribution-section {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--slate-800);
  border-radius: 8px;
  border: 1px solid var(--slate-700);
}

.dist-heading {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--off-white);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--slate-700);
}

.dist-bar {
  display: grid;
  grid-template-columns: 6rem 1fr 7rem;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dist-bar:last-child {
  margin-bottom: 0;
}

.dist-label {
  font-size: 0.875rem;
  color: var(--slate-300);
  text-align: right;
}

.dist-track {
  height: 1.5rem;
  background: var(--navy);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--slate-700);
}

.dist-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sky), var(--cyan));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.dist-value {
  font-size: 0.875rem;
  color: var(--off-white);
  font-weight: 500;
  text-align: right;
}
}
