/* ============================================================
   CRC 质量融合系统 - 自定义样式
   ============================================================ */

:root {
  --primary: #1890ff;
  --primary-dark: #096dd9;
  --sidebar-bg: #001529;
  --sidebar-width: 220px;
  --header-height: 50px;
  --sidebar-text: rgba(255,255,255,.65);
  --sidebar-text-active: #fff;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  background: #f0f2f5;
  margin: 0;
}

/* ---- Layout ---- */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo span {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.sidebar-logo span.sub { font-size: 11px; font-weight: 400; opacity: .75; display: block; }

.sidebar-menu { padding: 8px 0; }

.sidebar-group-label {
  color: rgba(255,255,255,.35);
  font-size: 11px;
  padding: 10px 16px 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  transition: all .15s;
  white-space: nowrap;
  border-left: 3px solid transparent;
}

.sidebar-menu a:hover { color: var(--sidebar-text-active); background: rgba(255,255,255,.05); }
.sidebar-menu a.active { color: var(--sidebar-text-active); background: var(--primary); border-left-color: #fff; }
.sidebar-menu a i { width: 18px; text-align: center; font-size: 15px; }

.sidebar-submenu { display: none; background: rgba(0,0,0,.15); }
.sidebar-submenu.open { display: block; }
.sidebar-submenu a { padding-left: 40px; font-size: 13px; }

.nav-collapse-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  transition: all .15s;
}
.nav-collapse-btn:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-collapse-btn .arrow { margin-left: auto; transition: transform .2s; }
.nav-collapse-btn.open .arrow { transform: rotate(90deg); }

.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-header {
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 4px rgba(0,21,41,.08);
}

.top-header .user-info { color: #333; font-size: 13px; display: flex; align-items: center; gap: 6px; }

.page-content { flex: 1; padding: 20px; }

/* ---- Cards ---- */
.card { border: none; box-shadow: 0 1px 3px rgba(0,0,0,.08); border-radius: 4px; }
.card-header { background: #fff; border-bottom: 1px solid #f0f0f0; padding: 12px 16px; font-weight: 600; font-size: 14px; }

/* ---- Tables ---- */
.table th { background: #fafafa; font-weight: 600; font-size: 13px; white-space: nowrap; }
.table td { font-size: 13px; vertical-align: middle; }

/* ---- Buttons ---- */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ---- Charts ---- */
.chart-container { width: 100%; position: relative; }

/* ---- Forms ---- */
.form-label { font-weight: 500; font-size: 13px; }
.form-control, .form-select { font-size: 13px; }

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #001529 0%, #003a70 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: #fff;
  border-radius: 8px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

.login-title { font-size: 20px; font-weight: 700; color: #333; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: #999; margin-bottom: 28px; }

/* ---- Step wizard ---- */
.step-bar { display: flex; align-items: flex-start; margin-bottom: 24px; }
.step-item { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.step-item::after { content:''; position:absolute; top:16px; left:50%; width:100%; height:2px; background:#e8e8e8; z-index:0; }
.step-item:last-child::after { display:none; }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: #e8e8e8; color: #999;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; position: relative; z-index: 1;
  transition: all .2s;
}
.step-circle.active { background: var(--primary); color: #fff; }
.step-circle.done { background: #52c41a; color: #fff; }
.step-label { font-size: 12px; margin-top: 6px; color: #999; }
.step-label.active { color: var(--primary); font-weight: 600; }

/* ---- Badge ---- */
.badge-warning-text { color: #faad14; }

/* ---- Misc ---- */
.text-primary { color: var(--primary) !important; }
.cursor-pointer { cursor: pointer; }

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
