/* tutorial.css — 使用教程页（从 core-assistant 内联 style 抽离，2026-07-17 重排）
 * 加载顺序：tokens → base → v5-theme → settings-v3 → tutorial → refinements
 */

@keyframes tutFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

html body .app-shell .tut-wrapper {
  padding: 16px 16px 48px;
  max-width: 1280px;
  margin: 0 auto;
  box-sizing: border-box;
  animation: tutFadeIn 0.36s cubic-bezier(0.16, 1, 0.3, 1);
  /* 与设置页一致：wrapper 透明，canvas 用 page-body 统一背景 */
  background: transparent;
  color: var(--text-main);
}

html body .app-shell .tut-hero {
  text-align: left;
  margin-bottom: 28px;
  padding: 24px 26px 22px;
  border-radius: var(--radius-lg, 12px);
  background: var(--bg-panel, #fff);
  border: 1px solid var(--line, #d0d7de);
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

html body .app-shell .tut-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1e40af, #2563eb, #93c5fd);
}

html body .app-shell .tut-hero h1 {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
  color: var(--text-main);
  background: none;
  -webkit-text-fill-color: currentColor;
  line-height: 1.25;
}

html body .app-shell .tut-hero p {
  font-size: 14px;
  color: var(--text-sub);
  max-width: 720px;
  margin: 0;
  line-height: 1.65;
}

html body .app-shell .tut-hero-stats {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

html body .app-shell .tut-hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-soft, #eef1f4);
  color: var(--text-sub);
  border: 1px solid var(--line, #d0d7de);
}

html body .app-shell .tut-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

html body .app-shell .tut-timeline::before {
  content: "";
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 23px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(37, 99, 235, 0.35) 0%,
    rgba(37, 99, 235, 0.12) 70%,
    transparent 100%
  );
}

html body .app-shell .tut-step {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  position: relative;
  align-items: start;
}

html body .app-shell .tut-num {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-panel, #fff);
  border: 1px solid color-mix(in srgb, var(--c, #2563eb) 28%, var(--line, #d0d7de));
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--c, #2563eb);
  flex-shrink: 0;
  z-index: 1;
  position: relative;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

html body .app-shell .tut-card {
  background: var(--bg-panel, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: 18px 20px;
  border: 1px solid var(--line, #d0d7de);
  box-shadow: none;
  transition: border-color 0.18s ease, background 0.18s ease;
  min-width: 0;
  overflow: visible;
  position: relative;
  z-index: 0;
}

html body .app-shell .tut-card:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--c, #2563eb) 28%, var(--line, #d0d7de));
  box-shadow: none;
}

/* 标题行：左图右文，禁止插图压住文字 */
html body .app-shell .tut-card-head {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
  width: 100%;
  min-width: 0;
  position: relative;
  z-index: 1;
}

html body .app-shell .tut-illust {
  width: 56px;
  height: 56px;
  min-width: 56px;
  max-width: 56px;
  min-height: 56px;
  max-height: 56px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c, #2563eb) 10%, var(--bg-soft, #eef1f4));
  border: 1px solid color-mix(in srgb, var(--c, #2563eb) 16%, var(--line, #d0d7de));
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 56px;
  overflow: hidden;
  position: relative;
  z-index: 0;
  isolation: isolate;
  box-sizing: border-box;
}

html body .app-shell .tut-illust svg {
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  display: block;
  flex: 0 0 auto;
}

html body .app-shell .tut-title-block {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  z-index: 1;
  overflow: visible;
}

html body .app-shell .tut-card h3,
html body .app-shell .tut-title-block h3 {
  font-size: 16px;
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text-main);
  position: relative;
  z-index: 1;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
  /* 不要被插图叠层：确保在正常文档流 */
  display: block;
}

html body .app-shell .tut-desc {
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.6;
  margin: 0;
  position: relative;
  z-index: 1;
}

html body .app-shell .tut-bullets {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 6px;
}

html body .app-shell .tut-bullets li {
  position: relative;
  padding: 8px 12px 8px 24px;
  border-radius: 8px;
  background: var(--bg-soft, #eef1f4);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid var(--line-soft, transparent);
}

html body .app-shell .tut-bullets li::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c, #2563eb);
  opacity: 0.85;
}

html body .app-shell .tut-bullets li strong {
  color: var(--c, #2563eb);
  font-weight: 700;
}

html body .app-shell .tut-example {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--c, #2563eb) 8%, transparent);
  border-left: 3px solid var(--c, #2563eb);
  color: var(--text-main);
  font-size: 12.5px;
  line-height: 1.6;
}

html body .app-shell .tut-jump {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c, #2563eb) 12%, transparent);
  color: var(--c, #2563eb);
  border: 1px solid color-mix(in srgb, var(--c, #2563eb) 28%, transparent);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}

html body .app-shell .tut-jump:hover {
  background: color-mix(in srgb, var(--c, #2563eb) 18%, transparent);
  transform: none;
}

html[data-theme="dark"] body .app-shell .tut-hero,
html[data-theme="dark"] body .app-shell .tut-num,
html[data-theme="dark"] body .app-shell .tut-card {
  background: var(--bg-panel, #121820);
  border-color: var(--line, rgba(255, 255, 255, 0.1));
}

html[data-theme="dark"] body .app-shell .tut-bullets li {
  background: var(--bg-soft, #18202a);
  border-color: var(--line, rgba(255, 255, 255, 0.08));
}

html[data-theme="dark"] body .app-shell .tut-hero-stat {
  background: var(--bg-soft, #18202a);
  border-color: var(--line, rgba(255, 255, 255, 0.08));
}

html[data-theme="dark"] body .app-shell .tut-hero h1 {
  color: var(--text-main, #e6edf3);
}

@media (max-width: 860px) {
  html body .app-shell .tut-wrapper {
    padding: 16px 14px 48px;
  }

  html body .app-shell .tut-hero {
    padding: 18px 16px;
    margin-bottom: 18px;
  }

  html body .app-shell .tut-hero h1 {
    font-size: 20px;
  }

  html body .app-shell .tut-step {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  html body .app-shell .tut-num {
    width: 40px;
    height: 40px;
    font-size: 14px;
    border-radius: 10px;
  }

  html body .app-shell .tut-timeline::before {
    display: none;
  }

  html body .app-shell .tut-card {
    padding: 16px;
  }

  html body .app-shell .tut-card-head {
    gap: 12px;
  }

  html body .app-shell .tut-illust {
    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    min-height: 48px;
    max-height: 48px;
    flex: 0 0 48px;
  }

  html body .app-shell .tut-illust svg {
    width: 34px;
    height: 34px;
    max-width: 34px;
    max-height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .app-shell .tut-wrapper {
    animation: none;
  }
}
