/* ==========================================================================
   花漾培训系统 2.0 - 首次登录角色化全屏向导 + 首页待办区块 + 顶栏帮助按钮
   Apple 风格：全部使用 style.css 的 CSS 变量，含深色模式与 768px 移动端适配
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 全屏向导遮罩
   -------------------------------------------------------------------------- */
.ob-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;                      /* 高于一切（modal 99 / toast 9999） */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: ob-fade-in 0.25s var(--ease);
  overflow-y: auto;
}

@keyframes ob-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ob-slide-up {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --------------------------------------------------------------------------
   2. 向导卡片
   -------------------------------------------------------------------------- */
.ob-card {
  width: 100%;
  max-width: 560px;
  background: var(--bg);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: 32px 36px 24px;
  animation: ob-slide-up 0.4s var(--ease);
  border: 1px solid var(--border-light);
}

.ob-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: 20px;
}

.ob-brand {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ob-badge {
  flex-shrink: 0;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.03em;
}

.ob-badge--admin {
  background: var(--danger-bg);
  color: var(--danger);
}

.ob-badge--core {
  background: var(--warning-bg);
  color: var(--warning);
}

.ob-badge--user {
  background: var(--accent-bg);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   3. 进度点（第 x / 共 n 步）
   -------------------------------------------------------------------------- */
.ob-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.ob-progress__text {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ob-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ob-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.ob-dot--done {
  background: var(--accent);
  opacity: 0.45;
}

.ob-dot--active {
  background: var(--accent);
  transform: scale(1.3);
}

/* --------------------------------------------------------------------------
   4. 步骤内容
   -------------------------------------------------------------------------- */
.ob-body {
  text-align: center;
  padding: 8px 8px 4px;
}

.ob-icon {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 16px;
}

.ob-title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 12px;
}

.ob-text {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  max-width: 420px;
  margin: 0 auto;
}

.ob-tip {
  display: inline-flex;
  align-items: center;
  margin-top: 20px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--accent-bg);
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   5. 底部按钮（跳过 / 上一步 / 下一步）
   -------------------------------------------------------------------------- */
.ob-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: 32px;
}

.ob-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ob-btn {
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.1s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.ob-btn:hover {
  background: var(--bg-inset);
}

.ob-btn:active {
  transform: scale(0.97);
}

.ob-btn--ghost {
  color: var(--text-tertiary);
}

.ob-btn--primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px -2px var(--accent);
}

.ob-btn--primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   6. 顶栏帮助按钮（与主题按钮同规格）
   -------------------------------------------------------------------------- */
.topbar__help-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  line-height: 1;
  transition: background 0.2s var(--ease);
  cursor: pointer;
  color: var(--text);
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.topbar__help-btn:hover {
  background: var(--bg-inset);
}

/* --------------------------------------------------------------------------
   7. 首页待办事项区块
   -------------------------------------------------------------------------- */
.dashboard__todos {
  margin-bottom: var(--space-lg);
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.todo-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  text-decoration: none;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.todo-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--border);
  text-decoration: none;
}

.todo-item__icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--accent-bg);
  border-radius: var(--radius-md);
}

.todo-item__text {
  flex: 1;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--text);
  line-height: var(--lh-normal);
}

.todo-item__badge {
  flex-shrink: 0;
  min-width: 24px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #ffffff;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.todo-item__arrow {
  flex-shrink: 0;
  color: var(--text-tertiary);
  font-size: var(--fs-md);
  transition: transform 0.2s var(--ease);
}

.todo-item:hover .todo-item__arrow {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   8. 深色模式
   -------------------------------------------------------------------------- */
[data-theme="dark"] .ob-card {
  background: var(--bg-inset);
  border-color: var(--border);
}

[data-theme="dark"] .ob-text {
  color: var(--text-secondary);
}

[data-theme="dark"] .todo-item {
  background: var(--bg-inset);
  border-color: var(--border);
}

[data-theme="dark"] .todo-item:hover {
  border-color: var(--border);
}

/* --------------------------------------------------------------------------
   9. 移动端适配（≤768px）
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .ob-overlay {
    padding: 16px;
    align-items: flex-end;               /* 底部抽屉式，更贴合手机操作 */
  }

  .ob-card {
    max-width: 100%;
    padding: 24px 18px 16px;
    border-radius: var(--radius-xl);
  }

  .ob-icon {
    font-size: 48px;
    margin-bottom: 12px;
  }

  .ob-title {
    font-size: var(--fs-xl);
  }

  .ob-text {
    font-size: var(--fs-base);
  }

  .ob-footer {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
  }

  .ob-nav {
    width: 100%;
    justify-content: flex-end;
  }

  .ob-btn {
    padding: 10px 16px;
    font-size: var(--fs-base);
  }

  .todo-item {
    padding: var(--space-md);
  }
}
