/* ============================================================
 * Longlight - 长光雨滴小站 | 布局组件 — 侧栏 / 顶部导航 / 步骤 / 进度
 * components/layout.css
 * 来源：~README/项目架构.js → 风格.控件
 * ============================================================ */

/* ---- 侧栏 ---- */
.sidebar {
  width: 240px;
  background: var(--green-900);
  color: var(--green-500);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-wide { width: 280px; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-icon-text);
  height: 44px;
  padding: 0 var(--space-form-field);
  cursor: pointer;
  color: var(--green-500);
  transition: background var(--duration-hover) var(--ease-out);
  position: relative;
}

/* 深绿底上的 hover / 选中背景：rgba(255,255,255,.06) */
.sidebar-item:hover { background: var(--hover-bg-on-green); }

.sidebar-item.active {
  background: var(--hover-bg-on-green);
  color: var(--surface-emphasis);
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--warm-600);
}

/* ---- 顶部导航 ---- */
.top-nav {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 var(--space-page-desktop);
  border-bottom: var(--border-default);
  background: var(--surface);
  gap: var(--space-between-cards);
}

/* ---- 步骤条 ---- */
.steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-form-label);
  flex: 1;
  position: relative;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-btn);
  border: var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font: var(--text-caption);
  color: var(--text-secondary);
  background: var(--surface-emphasis);
  z-index: 1;
}

.step.active .step-num {
  background: var(--green-900);
  color: var(--surface-emphasis);
  border-color: var(--green-900);
}

.step.done .step-num {
  background: var(--success);
  color: var(--surface-emphasis);
  border-color: var(--success);
}

.step-label { font: var(--text-ui); color: var(--text-secondary); }
.step.active .step-label { color: var(--text-primary); }

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 12px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 1px;
  background: var(--line);
}

/* ---- 进度条：高 2/4px，背景细线色，前景深绿，320ms ease-out ---- */
.progress {
  display: block;
  width: 100%;
  height: 4px;
  background: var(--line);
  overflow: hidden;
}

.progress-thin { height: 2px; }

.progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green-900);
  transition: width var(--duration-progress) var(--ease-out);
}

/* ---- 响应式：窄屏页边距取 24px（风格.间隔.页面左右边距）---- */
@media (max-width: 768px) {
  .top-nav { padding: 0 var(--space-page-mobile); }
}
