@@ -686,27 +681,22 @@ source ~/.bashrc`,
{
component: createKeyStep,
title: t('创建密钥'),
- color: 'var(--brand-gradient-via)',
},
{
component: viewModelsStep,
title: t('查看可用模型'),
- color: 'var(--brand-gradient-to)',
},
{
component: rechargeStep,
title: t('充值'),
- color: 'var(--brand-primary)',
},
{
component: installClientStep,
title: t('安装客户端'),
- color: 'var(--brand-gradient-from)',
},
{
component: startJourneyStep,
title: t('开启之旅'),
- color: 'var(--brand-primary-hover)',
},
];
@@ -724,14 +714,15 @@ source ~/.bashrc`,
const stepsTutorial = (
{/* 顶部快速导航 */}
-
+
+
{/* 可滚动的内容区域 */}
{visibleStepComponents.map((step, index) => (
-
-
+
{step.number} / {allStepComponents.length}
{step.component}
-
+
))}
@@ -814,20 +808,15 @@ source ~/.bashrc`,
{t('5 分钟快速上手,开启您的 AI 之旅')}
-
}
- onClick={(e) => {
- e.preventDefault();
- e.stopPropagation();
- handleClose();
- }}
- className='tutorial-close-btn'
- size='large'
- >
- {t('关闭教程')}
-
+
+ }
+ aria-label={t('关闭教程')}
+ onClick={handleClose}
+ className='tutorial-close-btn'
+ />
+
{/* 教程类型切换 Tab */}
diff --git a/src/pages/Tutorial/styles.css b/src/pages/Tutorial/styles.css
index 27c80940..b1e95378 100644
--- a/src/pages/Tutorial/styles.css
+++ b/src/pages/Tutorial/styles.css
@@ -1,1996 +1,451 @@
-/*
-Copyright (C) 2025 QuantumNous
+/* Copyright (C) 2025 QuantumNous */
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU Affero General Public License as
-published by the Free Software Foundation, either version 3 of the
-License, or (at your option) any later version.
-*/
-
-/* ===== 容器 ===== */
.tutorial-container {
- max-width: 900px;
- margin: 40px auto 40px;
- padding: 0 24px;
- position: relative;
-}
-
-/* 添加背景装饰 */
-.tutorial-container::before {
- content: '';
- position: fixed;
- top: -50%;
- left: -50%;
- width: 200%;
- height: 200%;
- background:
- radial-gradient(
- circle at 50% 50%,
- color-mix(in srgb, var(--brand-primary) 5%, transparent) 0%,
- transparent 50%
- ),
- radial-gradient(
- circle at 80% 20%,
- color-mix(in srgb, var(--brand-gradient-via) 4%, transparent) 0%,
- transparent 40%
- ),
- radial-gradient(
- circle at 20% 80%,
- color-mix(in srgb, var(--brand-primary) 4%, transparent) 0%,
- transparent 40%
- );
- animation: backgroundMove 20s ease-in-out infinite;
- pointer-events: none;
- z-index: -1;
-}
-
-/* 浮动装饰元素 */
-.tutorial-container::after {
- content: '';
- position: fixed;
- top: 20%;
- right: 10%;
- width: 150px;
- height: 150px;
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 10%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 8%, transparent)
- );
- border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
- animation: floatShape 15s ease-in-out infinite;
- pointer-events: none;
- z-index: -1;
-}
-
-@keyframes backgroundMove {
- 0%,
- 100% {
- transform: translate(0, 0) rotate(0deg);
- }
- 25% {
- transform: translate(2%, -2%) rotate(90deg);
- }
- 50% {
- transform: translate(-2%, 2%) rotate(180deg);
- }
- 75% {
- transform: translate(2%, 2%) rotate(270deg);
- }
-}
-
-@keyframes floatShape {
- 0%,
- 100% {
- transform: translateY(0) rotate(0deg);
- border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
- }
- 25% {
- transform: translateY(-20px) rotate(90deg);
- border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
- }
- 50% {
- transform: translateY(-40px) rotate(180deg);
- border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
- }
- 75% {
- transform: translateY(-20px) rotate(270deg);
- border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
- }
-}
-
-/* ===== 头部 ===== */
-.tutorial-header {
- text-align: center;
- margin-bottom: 24px;
- position: relative;
- min-height: 80px;
-}
-
-.tutorial-header-content {
- position: relative;
- z-index: 1;
-}
-
-.tutorial-close-btn {
- position: absolute !important;
- top: 0;
- right: 0;
- border-radius: 16px !important;
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
- background: linear-gradient(
- 135deg,
- rgba(255, 255, 255, 0.95),
- rgba(255, 255, 255, 0.85)
- ) !important;
- backdrop-filter: blur(10px);
- border: 2px solid color-mix(in srgb, var(--brand-primary) 20%, transparent) !important;
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
- font-weight: 500 !important;
- padding: 0 20px !important;
- /* 不能用 100:固定顶栏也是 z-index:100,且没有祖先创建层叠上下文,
- 本按钮会在根层叠上下文里以 DOM 靠后取胜,盖住顶栏右上角的通知/主题/头像。
- 压到顶栏之下即可,它本身在内容区内不会被谁遮挡。 */
- z-index: 20 !important;
- cursor: pointer !important;
- pointer-events: auto !important;
-}
-
-.tutorial-close-btn:hover {
- transform: translateY(-3px) scale(1.02) !important;
- box-shadow: 0 8px 24px
- color-mix(in srgb, var(--brand-primary) 25%, transparent) !important;
- border-color: color-mix(
- in srgb,
- var(--brand-primary) 50%,
- transparent
- ) !important;
- background: linear-gradient(
- 135deg,
- #fff,
- color-mix(in srgb, var(--brand-primary) 8%, #fff)
- ) !important;
-}
-
-.tutorial-close-btn:active {
- transform: translateY(-1px) scale(0.98) !important;
-}
-
-.tutorial-header-badge {
- display: inline-block;
- padding: 4px 12px;
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 10%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 10%, transparent)
- );
- border: 1px solid color-mix(in srgb, var(--brand-primary) 20%, transparent);
- border-radius: 20px;
- font-size: 12px;
- font-weight: 500;
- color: var(--brand-primary);
- margin-bottom: 10px;
- position: relative;
- overflow: hidden;
- animation: badgePulse 3s ease-in-out infinite;
-}
-
-.tutorial-header-badge::before {
- content: '';
- position: absolute;
- top: -50%;
- left: -50%;
- width: 200%;
- height: 200%;
- background: linear-gradient(
- 45deg,
- transparent,
- rgba(255, 255, 255, 0.3),
- transparent
- );
- transform: rotate(45deg);
- animation: badgeShine 3s linear infinite;
-}
-
-@keyframes badgePulse {
- 0%,
- 100% {
- box-shadow: 0 0 0 0
- color-mix(in srgb, var(--brand-primary) 40%, transparent);
- }
- 50% {
- box-shadow: 0 0 20px 5px
- color-mix(in srgb, var(--brand-primary) 20%, transparent);
- }
-}
-
-@keyframes badgeShine {
- 0% {
- transform: translateX(-100%) translateY(-100%) rotate(45deg);
- }
- 100% {
- transform: translateX(100%) translateY(100%) rotate(45deg);
- }
-}
-
-.tutorial-title {
- margin-bottom: 8px !important;
- background: linear-gradient(
- 135deg,
- var(--brand-primary),
- var(--brand-gradient-via),
- var(--brand-gradient-to)
- );
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- background-clip: text;
- font-size: 32px !important;
- position: relative;
- animation: titleFloat 3s ease-in-out infinite;
- background-size: 200% auto;
- animation:
- titleGradient 4s ease infinite,
- titleFloat 3s ease-in-out infinite;
-}
-
-@keyframes titleGradient {
- 0%,
- 100% {
- background-position: 0% 50%;
- }
- 50% {
- background-position: 100% 50%;
- }
-}
-
-@keyframes titleFloat {
- 0%,
- 100% {
- transform: translateY(0);
- }
- 50% {
- transform: translateY(-5px);
- }
-}
-
-.tutorial-subtitle {
- font-size: 14px;
- max-width: 400px;
+ --tt-accent: var(--brand-primary);
+ --tt-soft: var(--brand-primary-soft);
+ --tt-surface: var(--surface-card);
+ --tt-muted: var(--surface-bg-base);
+ --tt-text: var(--text-primary);
+ --tt-secondary: var(--text-secondary);
+ --tt-border: var(--border-subtle);
+ width: 100%;
+ max-width: 1240px;
margin: 0 auto;
+ padding: 32px 30px 48px;
+ padding-top: calc(
+ var(--console-header-offset, 72px) - var(--content-top-offset, 0px) + 32px
+ );
+ color: var(--tt-text);
}
-/* ===== 进度条 ===== */
-.tutorial-progress-wrapper {
- margin-bottom: 40px;
-}
-
-.tutorial-progress-bar {
- height: 4px;
- background: var(--ui-color-fill-1);
- border-radius: 4px;
+.tutorial-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-start;
+ gap: 24px;
margin-bottom: 24px;
- overflow: hidden;
}
-
-.tutorial-progress-fill {
- height: 100%;
- background: linear-gradient(
- 90deg,
- var(--brand-primary),
- var(--brand-gradient-via),
- var(--brand-gradient-to)
- );
- border-radius: 4px;
- transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
+.tutorial-header-content {
+ min-width: 0;
}
-
-/* ===== 步骤指示器 ===== */
-.tutorial-steps-indicator {
- display: flex;
- justify-content: space-between;
- position: relative;
-}
-
-.tutorial-step-dot {
- display: flex;
- flex-direction: column;
- align-items: center;
- cursor: pointer;
- flex: 1;
- transition: all 0.3s ease;
-}
-
-.tutorial-step-dot:hover {
- transform: translateY(-2px);
-}
-
-.tutorial-step-dot-inner {
- width: 48px;
- height: 48px;
- border-radius: 50%;
- background: var(--ui-color-fill-1);
- display: flex;
- align-items: center;
- justify-content: center;
- color: var(--ui-color-text-2);
- transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
- position: relative;
- z-index: 1;
-}
-
-.tutorial-step-dot:hover .tutorial-step-dot-inner {
- background: var(--ui-color-fill-2);
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
-}
-
-.tutorial-step-dot.active .tutorial-step-dot-inner {
- background: var(--step-color, var(--brand-primary));
- color: white;
- box-shadow: 0 4px 20px
- color-mix(in srgb, var(--step-color, var(--brand-primary)) 40%, transparent);
- transform: scale(1.1);
-}
-
-.tutorial-step-dot.completed .tutorial-step-dot-inner {
- background: linear-gradient(135deg, #10b981, #14b8a6);
- color: white;
-}
-
-.tutorial-step-label {
- margin-top: 10px;
- font-size: 13px;
- color: var(--ui-color-text-2);
- transition: all 0.3s ease;
- text-align: center;
- white-space: nowrap;
-}
-
-.tutorial-step-dot.active .tutorial-step-label {
- color: var(--step-color, var(--brand-primary));
+.tutorial-header-badge,
+.tutorial-directory-title {
+ color: var(--tt-accent);
+ font-size: 12px;
font-weight: 600;
-}
-
-.tutorial-step-dot.completed .tutorial-step-label {
- color: #10b981;
-}
-
-/* ===== 内容区域 ===== */
-.tutorial-content {
- background: var(--ui-color-bg-1);
- border-radius: 20px;
- padding: 40px;
- min-height: 500px;
- box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
- border: 1px solid var(--ui-color-border);
- position: relative;
- overflow: hidden;
-}
-
-.tutorial-content::before {
- content: '';
- position: absolute;
- top: -50%;
- left: -50%;
- width: 200%;
- height: 200%;
- background: linear-gradient(
- 45deg,
- transparent 30%,
- color-mix(in srgb, var(--brand-primary) 2%, transparent) 50%,
- transparent 70%
- );
- animation: contentShimmer 8s linear infinite;
- pointer-events: none;
-}
-
-@keyframes contentShimmer {
- 0% {
- transform: translateX(-100%) translateY(-100%);
- }
- 100% {
- transform: translateX(100%) translateY(100%);
- }
-}
-
-.tutorial-step-content {
- animation: fadeInUp 0.4s ease-out;
- position: relative;
- z-index: 1;
-}
-
-@keyframes fadeInUp {
- from {
- opacity: 0;
- transform: translateY(20px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
-}
-
-/* ===== 步骤头部 ===== */
-.tutorial-step-header {
- display: flex;
- align-items: flex-start;
- gap: 20px;
- margin-bottom: 32px;
-}
-
-.tutorial-step-icon {
- width: 56px;
- height: 56px;
- border-radius: 16px;
- display: flex;
- align-items: center;
- justify-content: center;
- color: white;
- flex-shrink: 0;
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
-}
-
-.tutorial-step-header h3 {
- margin-bottom: 4px !important;
-}
-
-/* ===== 卡片样式 ===== */
-.tutorial-card {
- margin-bottom: 20px;
- border-radius: 18px !important;
- border: 2px solid var(--ui-color-border) !important;
- overflow: hidden;
- position: relative;
-}
-
-.tutorial-card::before {
- content: '';
- position: absolute;
- top: -2px;
- left: -2px;
- right: -2px;
- bottom: -2px;
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 10%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 10%, transparent),
- color-mix(in srgb, var(--brand-primary) 10%, transparent)
- );
- border-radius: 18px;
- opacity: 0;
- transition: opacity 0.3s ease;
- z-index: -1;
-}
-
-.tutorial-card-animated {
- transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
-}
-
-.tutorial-card-animated:hover {
- transform: translateY(-3px);
- box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
-}
-
-.tutorial-card-animated:hover::before {
- opacity: 1;
-}
-
-/* ===== 步骤列表 ===== */
-.tutorial-steps-list {
- display: flex;
- flex-direction: column;
- gap: 16px;
-}
-
-.tutorial-step-item {
- display: flex;
- align-items: center;
- gap: 16px;
- padding: 14px 18px;
- background: var(--ui-color-fill-0);
- border-radius: 14px;
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- position: relative;
- overflow: hidden;
-}
-
-.tutorial-step-item::before {
- content: '';
- position: absolute;
- left: 0;
- top: 0;
- bottom: 0;
- width: 4px;
- background: linear-gradient(
- 135deg,
- var(--brand-primary),
- var(--brand-gradient-via)
- );
- transform: scaleY(0);
- transition: transform 0.3s ease;
-}
-
-.tutorial-step-item:hover::before {
- transform: scaleY(1);
-}
-
-.tutorial-step-item:hover {
- background: var(--ui-color-fill-1);
- transform: translateX(6px);
- box-shadow: 0 4px 12px
- color-mix(in srgb, var(--brand-primary) 15%, transparent);
-}
-
-.tutorial-step-number {
- width: 32px;
- height: 32px;
- border-radius: 50%;
- background: linear-gradient(
- 135deg,
- var(--brand-primary),
- var(--brand-gradient-via)
- );
- color: white;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 14px;
- font-weight: 600;
- flex-shrink: 0;
- box-shadow: 0 4px 12px
- color-mix(in srgb, var(--brand-primary) 30%, transparent);
- transition: all 0.3s ease;
-}
-
-.tutorial-step-item:hover .tutorial-step-number {
- transform: scale(1.1) rotate(5deg);
- box-shadow: 0 6px 16px
- color-mix(in srgb, var(--brand-primary) 40%, transparent);
-}
-
-/* ===== 链接样式 ===== */
-.tutorial-link {
- color: var(--brand-primary);
- font-weight: 500;
- text-decoration: none;
- padding: 2px 8px;
- background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
- border-radius: 6px;
- transition: all 0.2s ease;
-}
-
-.tutorial-link:hover {
- background: color-mix(in srgb, var(--brand-primary) 20%, transparent);
- color: var(--brand-primary-hover);
-}
-
-.tutorial-link-orange {
- color: var(--brand-primary);
- background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
-}
-
-.tutorial-link-orange:hover {
- background: color-mix(in srgb, var(--brand-primary) 20%, transparent);
- color: var(--brand-primary-hover);
-}
-
-/* ===== 警告/提示卡片 ===== */
-.tutorial-warning-card {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 10%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 10%, transparent)
- ) !important;
- border-color: color-mix(
- in srgb,
- var(--brand-primary) 35%,
- transparent
- ) !important;
- position: relative;
- overflow: hidden;
-}
-
-.tutorial-warning-card::after {
- content: '';
- position: absolute;
- top: -50%;
- right: -10%;
- width: 100px;
- height: 200%;
- background: linear-gradient(
- 90deg,
- transparent,
- color-mix(in srgb, var(--brand-primary) 10%, transparent),
- transparent
- );
- transform: rotate(15deg);
- animation: warningShine 3s ease-in-out infinite;
-}
-
-@keyframes warningShine {
- 0%,
- 100% {
- opacity: 0;
- }
- 50% {
- opacity: 1;
- }
-}
-
-.tutorial-warning-content {
- display: flex;
- align-items: flex-start;
- gap: 16px;
- position: relative;
- z-index: 1;
-}
-
-.tutorial-warning-icon {
- font-size: 32px;
- line-height: 1;
- animation: warningPulse 2s ease-in-out infinite;
-}
-
-@keyframes warningPulse {
- 0%,
- 100% {
- transform: scale(1);
- }
- 50% {
- transform: scale(1.1);
- }
-}
-
-.tutorial-key-example {
- display: inline-block;
- margin-top: 8px;
- padding: 10px 18px;
- background: rgba(0, 0, 0, 0.06);
- border-radius: 10px;
- font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
- font-size: 14px;
- color: var(--ui-color-text-1);
- border: 1px solid color-mix(in srgb, var(--brand-primary) 20%, transparent);
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
-}
-
-.tutorial-tip-card {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 10%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 10%, transparent)
- ) !important;
- border-color: color-mix(
- in srgb,
- var(--brand-primary) 35%,
- transparent
- ) !important;
- position: relative;
- overflow: hidden;
-}
-
-.tutorial-tip-card::after {
- content: '💡';
- position: absolute;
- bottom: -20px;
- right: -20px;
- font-size: 120px;
- opacity: 0.05;
- transform: rotate(-15deg);
-}
-
-.tutorial-tip-content {
- display: flex;
- align-items: flex-start;
- gap: 16px;
- position: relative;
- z-index: 1;
-}
-
-.tutorial-tip-icon {
- font-size: 32px;
- line-height: 1;
- animation: tipGlow 2s ease-in-out infinite;
-}
-
-@keyframes tipGlow {
- 0%,
- 100% {
- filter: drop-shadow(
- 0 0 0 color-mix(in srgb, var(--brand-primary) 0%, transparent)
- );
- }
- 50% {
- filter: drop-shadow(
- 0 0 8px color-mix(in srgb, var(--brand-primary) 50%, transparent)
- );
- }
-}
-
-.tutorial-info-card {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-gradient-from) 10%, transparent),
- color-mix(in srgb, var(--brand-primary) 10%, transparent)
- ) !important;
- border-color: color-mix(
- in srgb,
- var(--brand-primary) 35%,
- transparent
- ) !important;
-}
-
-.tutorial-info-content {
- display: flex;
- align-items: flex-start;
- gap: 16px;
-}
-
-.tutorial-info-icon {
- font-size: 32px;
- line-height: 1;
-}
-
-/* ===== 模型标签 ===== */
-.tutorial-model-tags {
- display: flex;
- gap: 8px;
- margin-top: 12px;
- flex-wrap: wrap;
-}
-
-/* ===== 操作按钮 ===== */
-.tutorial-action-buttons {
- margin-top: 24px;
-}
-
-.tutorial-action-btn {
- border-radius: 14px !important;
- padding: 0 32px !important;
- height: 48px !important;
- font-weight: 600 !important;
- transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
- box-shadow: 0 4px 16px
- color-mix(in srgb, var(--brand-primary) 25%, transparent);
- position: relative;
- overflow: hidden;
-}
-
-.tutorial-action-btn::before {
- content: '';
- position: absolute;
- top: 50%;
- left: 50%;
- width: 0;
- height: 0;
- border-radius: 50%;
- background: rgba(255, 255, 255, 0.3);
- transform: translate(-50%, -50%);
- transition:
- width 0.6s ease,
- height 0.6s ease;
-}
-
-.tutorial-action-btn:hover::before {
- width: 300px;
- height: 300px;
-}
-
-.tutorial-action-btn:hover {
- transform: translateY(-3px) scale(1.02);
- box-shadow: 0 10px 28px
- color-mix(in srgb, var(--brand-primary) 35%, transparent);
-}
-
-.tutorial-action-btn-orange {
- box-shadow: 0 4px 16px
- color-mix(in srgb, var(--brand-primary) 25%, transparent);
-}
-
-.tutorial-action-btn-orange:hover {
- box-shadow: 0 10px 28px
- color-mix(in srgb, var(--brand-primary) 35%, transparent);
-}
-
-/* ===== 代码块 ===== */
-.tutorial-code-block {
- position: relative;
- background: var(--ui-color-bg-2);
- border-radius: 14px;
- margin: 12px 0;
- overflow: hidden;
- border: 2px solid var(--ui-color-border);
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
- transition: all 0.3s ease;
-}
-
-.tutorial-code-block:hover {
- border-color: color-mix(in srgb, var(--brand-primary) 30%, transparent);
- box-shadow: 0 6px 20px
- color-mix(in srgb, var(--brand-primary) 10%, transparent);
-}
-
-.tutorial-code-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 12px 18px;
- background: var(--ui-color-fill-0);
- border-bottom: 2px solid var(--ui-color-border);
- backdrop-filter: blur(10px);
-}
-
-.tutorial-copy-btn {
- transition: all 0.2s ease !important;
- border-radius: 8px !important;
-}
-
-.tutorial-copy-btn:hover {
- background: var(--ui-color-fill-1) !important;
- transform: scale(1.05);
-}
-
-.tutorial-code-content {
- margin: 0;
- padding: 18px;
- overflow-x: auto;
- font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
- font-size: 13px;
- line-height: 1.8;
- color: var(--ui-color-text-0);
-}
-
-.tutorial-code-content::-webkit-scrollbar {
- height: 8px;
-}
-
-.tutorial-code-content::-webkit-scrollbar-track {
- background: var(--ui-color-fill-0);
- border-radius: 4px;
-}
-
-.tutorial-code-content::-webkit-scrollbar-thumb {
- background: var(--brand-scroll);
- border-radius: 4px;
-}
-
-.tutorial-code-content::-webkit-scrollbar-thumb:hover {
- background: var(--brand-scroll-hover);
-}
-
-/* ===== OS 切换标签 ===== */
-.tutorial-os-tabs {
- margin-bottom: 0 !important;
-}
-
-.tutorial-tab-label {
- font-size: 14px;
- font-weight: 500;
-}
-
-.tutorial-tab-content {
- animation: fadeIn 0.3s ease;
-}
-
-@keyframes fadeIn {
- from {
- opacity: 0;
- }
- to {
- opacity: 1;
- }
-}
-
-/* ===== 命令网格 ===== */
-.tutorial-commands-grid {
- display: grid;
- grid-template-columns: repeat(2, 1fr);
- gap: 12px;
- margin-top: 16px;
-}
-
-.tutorial-command-item {
- display: flex;
- align-items: center;
- gap: 12px;
- padding: 14px 18px;
- background: var(--ui-color-fill-0);
- border-radius: 12px;
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- border: 2px solid transparent;
- position: relative;
- overflow: hidden;
-}
-
-.tutorial-command-item::before {
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 5%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 5%, transparent)
- );
- opacity: 0;
- transition: opacity 0.3s ease;
-}
-
-.tutorial-command-item:hover::before {
- opacity: 1;
-}
-
-.tutorial-command-item:hover {
- background: var(--ui-color-fill-1);
- transform: translateX(6px);
- border-color: color-mix(in srgb, var(--brand-primary) 20%, transparent);
- box-shadow: 0 4px 12px
- color-mix(in srgb, var(--brand-primary) 10%, transparent);
-}
-
-.tutorial-command-item code {
- padding: 6px 12px;
- background: linear-gradient(
- 135deg,
- var(--brand-primary),
- var(--brand-gradient-via)
- );
- color: white;
- border-radius: 8px;
- font-size: 13px;
- font-weight: 600;
- box-shadow: 0 2px 8px
- color-mix(in srgb, var(--brand-primary) 30%, transparent);
- transition: all 0.2s ease;
- position: relative;
- z-index: 1;
-}
-
-.tutorial-command-item:hover code {
- transform: scale(1.05);
- box-shadow: 0 4px 12px
- color-mix(in srgb, var(--brand-primary) 40%, transparent);
-}
-
-.tutorial-command-item span {
- color: var(--ui-color-text-1);
- font-size: 14px;
- position: relative;
- z-index: 1;
-}
-
-/* ===== 完成卡片 ===== */
-.tutorial-completion-card {
- text-align: center;
- padding: 48px 32px;
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 8%, transparent),
- color-mix(in srgb, var(--brand-primary-hover) 8%, transparent)
- );
- border-radius: 20px;
- margin-bottom: 32px;
- border: 2px solid color-mix(in srgb, var(--brand-primary) 20%, transparent);
- position: relative;
- overflow: hidden;
-}
-
-.tutorial-completion-card::before {
- content: '';
- position: absolute;
- top: -50%;
- left: -50%;
- width: 200%;
- height: 200%;
- background: radial-gradient(
- circle,
- color-mix(in srgb, var(--brand-primary) 15%, transparent) 0%,
- transparent 70%
- );
- animation: completionPulse 3s ease-in-out infinite;
-}
-
-@keyframes completionPulse {
- 0%,
- 100% {
- transform: translate(0, 0) scale(1);
- opacity: 0.5;
- }
- 50% {
- transform: translate(5%, 5%) scale(1.1);
- opacity: 1;
- }
-}
-
-.tutorial-completion-icon {
- font-size: 80px;
- margin-bottom: 20px;
- animation: bounce 1s ease-in-out infinite;
- filter: drop-shadow(
- 0 10px 20px color-mix(in srgb, var(--brand-primary) 30%, transparent)
- );
- position: relative;
- z-index: 1;
-}
-
-@keyframes bounce {
- 0%,
- 100% {
- transform: translateY(0) scale(1);
- }
- 50% {
- transform: translateY(-15px) scale(1.05);
- }
-}
-
-.tutorial-completion-card h4 {
- color: var(--brand-primary) !important;
- margin-bottom: 12px !important;
- font-size: 28px !important;
- position: relative;
- z-index: 1;
-}
-
-.tutorial-completion-card > p {
- position: relative;
- z-index: 1;
- margin-bottom: 24px;
- font-size: 16px;
-}
-
-.tutorial-completion-actions {
- margin-top: 28px;
- position: relative;
- z-index: 1;
-}
-
-.tutorial-completion-btn {
- border-radius: 16px !important;
- padding: 0 40px !important;
- height: 52px !important;
- font-weight: 600 !important;
- font-size: 16px !important;
- background: linear-gradient(
- 135deg,
- var(--brand-primary),
- var(--brand-primary-hover)
- ) !important;
- border: none !important;
- box-shadow: 0 8px 24px
- color-mix(in srgb, var(--brand-primary) 40%, transparent) !important;
- transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
- position: relative;
- overflow: hidden;
- cursor: pointer !important;
- pointer-events: auto !important;
- z-index: 10;
-}
-
-.tutorial-completion-btn::before {
- content: '';
- position: absolute;
- top: 0;
- left: -100%;
- width: 100%;
- height: 100%;
- background: linear-gradient(
- 90deg,
- transparent,
- rgba(255, 255, 255, 0.3),
- transparent
- );
- transition: left 0.6s ease;
-}
-
-.tutorial-completion-btn:hover::before {
- left: 100%;
-}
-
-.tutorial-completion-btn:hover {
- transform: translateY(-4px) scale(1.05) !important;
- box-shadow: 0 12px 32px
- color-mix(in srgb, var(--brand-primary) 50%, transparent) !important;
-}
-
-.tutorial-completion-btn:active {
- transform: translateY(-2px) scale(1.02) !important;
-}
-
-/* ===== 探索网格 ===== */
-.tutorial-next-steps {
- margin-top: 8px;
-}
-
-.tutorial-explore-grid {
- display: grid;
- grid-template-columns: repeat(2, 1fr);
- gap: 16px;
-}
-
-.tutorial-explore-card {
- display: flex;
- align-items: center;
- gap: 16px;
- padding: 24px;
- border-radius: 20px;
- text-decoration: none;
- transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
- border: 2px solid transparent;
- position: relative;
- overflow: hidden;
-}
-
-.tutorial-explore-card::before {
- content: '';
- position: absolute;
- top: 50%;
- left: 50%;
- width: 0;
- height: 0;
- border-radius: 50%;
- background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
- transform: translate(-50%, -50%);
- transition:
- width 0.6s ease,
- height 0.6s ease;
-}
-
-.tutorial-explore-card:hover::before {
- width: 300px;
- height: 300px;
-}
-
-.tutorial-explore-card:hover {
- transform: translateY(-6px) scale(1.02);
- box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
-}
-
-.tutorial-explore-card:hover .tutorial-explore-arrow {
- transform: translateX(6px);
- color: var(--ui-color-text-0);
-}
-
-.tutorial-explore-card:hover .tutorial-explore-icon {
- animation: iconBounce 0.6s ease;
-}
-
-@keyframes iconBounce {
- 0%,
- 100% {
- transform: translateY(0);
- }
- 25% {
- transform: translateY(-8px);
- }
- 50% {
- transform: translateY(0);
- }
- 75% {
- transform: translateY(-4px);
- }
-}
-
-.tutorial-explore-card-purple {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-gradient-via) 10%, transparent),
- color-mix(in srgb, var(--brand-gradient-to) 10%, transparent)
- );
- border-color: color-mix(in srgb, var(--brand-gradient-via) 25%, transparent);
-}
-
-.tutorial-explore-card-purple:hover {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-gradient-via) 18%, transparent),
- color-mix(in srgb, var(--brand-gradient-to) 18%, transparent)
- );
- border-color: color-mix(in srgb, var(--brand-gradient-via) 40%, transparent);
-}
-
-.tutorial-explore-card-blue {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-gradient-from) 10%, transparent),
- color-mix(in srgb, var(--brand-primary) 10%, transparent)
- );
- border-color: color-mix(in srgb, var(--brand-gradient-from) 25%, transparent);
-}
-
-.tutorial-explore-card-blue:hover {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-gradient-from) 18%, transparent),
- color-mix(in srgb, var(--brand-primary) 18%, transparent)
- );
- border-color: color-mix(in srgb, var(--brand-gradient-from) 40%, transparent);
-}
-
-.tutorial-explore-card-green {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 10%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 10%, transparent)
- );
- border-color: color-mix(in srgb, var(--brand-primary) 25%, transparent);
-}
-
-.tutorial-explore-card-green:hover {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 18%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 18%, transparent)
- );
- border-color: color-mix(in srgb, var(--brand-primary) 40%, transparent);
-}
-
-.tutorial-explore-card-orange {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary-hover) 10%, transparent),
- color-mix(in srgb, var(--brand-primary) 10%, transparent)
- );
- border-color: color-mix(in srgb, var(--brand-primary-hover) 25%, transparent);
-}
-
-.tutorial-explore-card-orange:hover {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary-hover) 18%, transparent),
- color-mix(in srgb, var(--brand-primary) 18%, transparent)
- );
- border-color: color-mix(in srgb, var(--brand-primary-hover) 40%, transparent);
-}
-
-.tutorial-explore-icon {
- font-size: 36px;
- flex-shrink: 0;
- transition: all 0.3s ease;
- filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
-}
-
-.tutorial-explore-content {
- flex: 1;
-}
-
-.tutorial-explore-content strong {
- color: var(--ui-color-text-0);
-}
-
-.tutorial-explore-arrow {
- color: var(--ui-color-text-2);
- transition: transform 0.3s ease;
-}
-
-/* ===== 底部导航 ===== */
-.tutorial-nav {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: 40px;
- padding: 24px 0;
- border-top: 1px solid var(--ui-color-border);
-}
-
-.tutorial-nav-btn {
- border-radius: 12px !important;
- padding: 0 24px !important;
- height: 44px !important;
- transition: all 0.3s ease !important;
-}
-
-.tutorial-nav-btn:not(:disabled):hover {
- transform: translateY(-2px);
-}
-
-.tutorial-nav-btn-next:not(:disabled):hover {
- box-shadow: 0 8px 20px
- color-mix(in srgb, var(--brand-primary) 30%, transparent);
-}
-
-.tutorial-nav-progress {
- display: flex;
- align-items: center;
- gap: 8px;
- font-size: 16px;
-}
-
-.tutorial-nav-current {
- font-size: 24px;
- font-weight: 700;
- color: var(--brand-primary);
-}
-
-.tutorial-nav-divider {
- color: var(--ui-color-text-3);
-}
-
-.tutorial-nav-total {
- color: var(--ui-color-text-2);
-}
-
-/* ===== 响应式 ===== */
-@media (max-width: 768px) {
- .tutorial-container {
- /* 必须 >= 移动端顶栏 56px。原值 30px 时顶部徽章被顶栏吞掉,
- 且只在跑马灯关闭时暴露(开着时 40px 占位恰好补上,反而正常)。 */
- margin-top: 60px;
- padding: 0 16px;
- }
-
- .tutorial-title {
- font-size: 24px !important;
- }
-
- .tutorial-content {
- padding: 24px 20px;
- border-radius: 16px;
- }
-
- .tutorial-step-header {
- flex-direction: column;
- align-items: flex-start;
- gap: 16px;
- }
-
- .tutorial-step-dot-inner {
- width: 40px;
- height: 40px;
- }
-
- .tutorial-step-label {
- font-size: 11px;
- }
-
- .tutorial-explore-grid {
- grid-template-columns: 1fr;
- }
-
- .tutorial-commands-grid {
- grid-template-columns: 1fr;
- }
-
- .tutorial-nav {
- flex-wrap: wrap;
- gap: 16px;
- }
-
- .tutorial-nav-progress {
- order: -1;
- width: 100%;
- justify-content: center;
- }
-
- .tutorial-nav-btn {
- flex: 1;
- }
-}
-
-/* ===== 深色模式 ===== */
-html.dark .tutorial-close-btn {
- background: linear-gradient(
- 135deg,
- rgba(40, 40, 55, 0.95),
- rgba(35, 35, 50, 0.85)
- ) !important;
- border-color: color-mix(
- in srgb,
- var(--brand-primary) 30%,
- transparent
- ) !important;
- color: var(--ui-color-text-0) !important;
-}
-
-html.dark .tutorial-close-btn:hover {
- background: linear-gradient(
- 135deg,
- rgba(50, 35, 55, 0.95),
- rgba(45, 30, 50, 0.9)
- ) !important;
- border-color: color-mix(
- in srgb,
- var(--brand-primary) 50%,
- transparent
- ) !important;
-}
-
-html.dark .tutorial-header-badge {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 15%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 15%, transparent)
- );
- border-color: color-mix(in srgb, var(--brand-primary) 30%, transparent);
-}
-
-html.dark .tutorial-code-block {
- background: rgba(0, 0, 0, 0.3);
-}
-
-html.dark .tutorial-code-header {
- background: rgba(0, 0, 0, 0.4);
-}
-
-html.dark .tutorial-key-example {
- background: rgba(255, 255, 255, 0.08);
-}
-
-html.dark .tutorial-step-item {
- background: rgba(255, 255, 255, 0.04);
-}
-
-html.dark .tutorial-step-item:hover {
- background: rgba(255, 255, 255, 0.08);
-}
-
-html.dark .tutorial-command-item {
- background: rgba(255, 255, 255, 0.04);
-}
-
-html.dark .tutorial-command-item:hover {
- background: rgba(255, 255, 255, 0.08);
-}
-
-html.dark .tutorial-warning-card {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 15%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 15%, transparent)
- ) !important;
- border-color: color-mix(
- in srgb,
- var(--brand-primary) 40%,
- transparent
- ) !important;
-}
-
-html.dark .tutorial-tip-card {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 15%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 15%, transparent)
- ) !important;
- border-color: color-mix(
- in srgb,
- var(--brand-primary) 40%,
- transparent
- ) !important;
-}
-
-html.dark .tutorial-info-card {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-gradient-from) 15%, transparent),
- color-mix(in srgb, var(--brand-primary) 15%, transparent)
- ) !important;
- border-color: color-mix(
- in srgb,
- var(--brand-primary) 40%,
- transparent
- ) !important;
-}
-
-html.dark .tutorial-completion-card {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 15%, transparent),
- color-mix(in srgb, var(--brand-primary-hover) 15%, transparent)
- );
- border-color: color-mix(in srgb, var(--brand-primary) 30%, transparent);
-}
-
-html.dark .tutorial-explore-card-purple {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-gradient-via) 15%, transparent),
- color-mix(in srgb, var(--brand-gradient-to) 15%, transparent)
- );
-}
-
-html.dark .tutorial-explore-card-purple:hover {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-gradient-via) 25%, transparent),
- color-mix(in srgb, var(--brand-gradient-to) 25%, transparent)
- );
-}
-
-html.dark .tutorial-explore-card-blue {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-gradient-from) 15%, transparent),
- color-mix(in srgb, var(--brand-primary) 15%, transparent)
- );
-}
-
-html.dark .tutorial-explore-card-blue:hover {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-gradient-from) 25%, transparent),
- color-mix(in srgb, var(--brand-primary) 25%, transparent)
- );
-}
-
-html.dark .tutorial-explore-card-green {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 15%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 15%, transparent)
- );
-}
-
-html.dark .tutorial-explore-card-green:hover {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 25%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 25%, transparent)
- );
-}
-
-html.dark .tutorial-explore-card-orange {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary-hover) 15%, transparent),
- color-mix(in srgb, var(--brand-primary) 15%, transparent)
- );
-}
-
-html.dark .tutorial-explore-card-orange:hover {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary-hover) 25%, transparent),
- color-mix(in srgb, var(--brand-primary) 25%, transparent)
- );
-}
-
-html.dark .tutorial-explore-card::before {
- background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent);
-}
-
-html.dark .tutorial-explore-card:hover {
- box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
-}
-
-html.dark .tutorial-container::after {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 6%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 4%, transparent)
- );
-}
-
-html.dark .tutorial-content {
- box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
-}
-
-html.dark .tutorial-card-animated:hover {
- box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
-}
-
-/* ===== 教程类型切换 Tab ===== */
-.tutorial-type-tabs {
- margin-bottom: 16px;
- position: relative;
-}
-
-/* Tab 容器卡片样式 */
-.tutorial-main-tabs {
- background: linear-gradient(
- 135deg,
- rgba(255, 255, 255, 0.95),
- rgba(255, 255, 255, 0.9)
- );
- backdrop-filter: blur(20px);
- border-radius: 16px;
- padding: 8px;
- border: 2px solid color-mix(in srgb, var(--brand-primary) 15%, transparent);
- box-shadow:
- 0 4px 24px color-mix(in srgb, var(--brand-primary) 8%, transparent),
- 0 1px 3px rgba(0, 0, 0, 0.05),
- inset 0 1px 0 rgba(255, 255, 255, 0.8);
- position: relative;
- overflow: hidden;
-}
-
-/* 装饰性渐变背景 */
-.tutorial-main-tabs::before {
- content: '';
- position: absolute;
- top: -50%;
- left: -50%;
- width: 200%;
- height: 200%;
- background:
- radial-gradient(
- circle at 30% 50%,
- color-mix(in srgb, var(--brand-primary) 5%, transparent) 0%,
- transparent 50%
- ),
- radial-gradient(
- circle at 70% 50%,
- color-mix(in srgb, var(--brand-gradient-via) 5%, transparent) 0%,
- transparent 50%
- );
- pointer-events: none;
- animation: tabBgMove 15s ease-in-out infinite;
-}
-
-@keyframes tabBgMove {
- 0%,
- 100% {
- transform: translate(0, 0);
- }
- 50% {
- transform: translate(5%, 0);
- }
-}
-
-/* Tab 栏样式 */
-
-/* 单个 Tab 样式 */
-
-/* Tab 悬停效果 */
-
-/* 激活状态的 Tab */
-
-/* 激活 Tab 的闪光效果 */
-
-@keyframes tabShine {
- 0% {
- left: -100%;
- }
- 50%,
- 100% {
- left: 100%;
- }
-}
-
-/* Tab 标签内容样式 */
-.tutorial-tab-label-main {
- display: flex;
- align-items: center;
- gap: 10px;
- font-weight: 600;
- font-size: 15px;
- letter-spacing: 0.3px;
-}
-
-@keyframes iconPop {
- 0% {
- transform: scale(1);
- }
- 50% {
- transform: scale(1.2);
- }
- 100% {
- transform: scale(1);
- }
-}
-
-/* Tab 内容区域 */
-.tutorial-tab-content-wrapper {
- padding: 16px 0;
- animation: tabContentFade 0.5s cubic-bezier(0.4, 0, 0.2, 1);
- position: relative;
-}
-
-@keyframes tabContentFade {
- 0% {
- opacity: 0;
- transform: translateY(16px);
- }
- 100% {
- opacity: 1;
- transform: translateY(0);
- }
-}
-
-/* Tab 切换指示器 - 视频/图文标识 */
-.tutorial-type-tabs::after {
- content: '';
- position: absolute;
- bottom: -8px;
- left: 50%;
- transform: translateX(-50%);
- width: 60px;
- height: 4px;
- background: linear-gradient(
- 90deg,
- var(--brand-primary),
- var(--brand-gradient-via),
- var(--brand-gradient-to)
- );
- border-radius: 2px;
- opacity: 0.6;
-}
-
-/* 响应式样式 */
-@media (max-width: 768px) {
- .tutorial-main-tabs {
- padding: 6px;
- border-radius: 14px;
- }
-
- .tutorial-tab-label-main {
- font-size: 13px;
- gap: 5px;
- }
-
- .tutorial-tab-content-wrapper {
- padding: 12px 0;
- }
-}
-
-/* 深色模式适配 */
-html.dark .tutorial-main-tabs {
- background: linear-gradient(
- 135deg,
- rgba(30, 30, 40, 0.95),
- rgba(25, 25, 35, 0.9)
- );
- border-color: color-mix(in srgb, var(--brand-primary) 25%, transparent);
- box-shadow:
- 0 4px 24px rgba(0, 0, 0, 0.3),
- 0 1px 3px rgba(0, 0, 0, 0.2),
- inset 0 1px 0 rgba(255, 255, 255, 0.05);
-}
-
-/* ===== 滚动浏览模式样式 ===== */
-.tutorial-scroll-wrapper {
- display: flex;
- flex-direction: column;
- height: calc(100vh - 250px);
- min-height: 500px;
-}
-
-/* 快速导航 */
-.tutorial-quick-nav {
- background: linear-gradient(
- 135deg,
- rgba(255, 255, 255, 0.95),
- rgba(255, 255, 255, 0.85)
- );
- backdrop-filter: blur(10px);
- border-radius: 12px;
- padding: 10px 16px;
- margin-bottom: 12px;
- border: 1px solid color-mix(in srgb, var(--brand-primary) 15%, transparent);
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
-}
-
-.tutorial-quick-nav-inner {
- display: flex;
- gap: 6px;
- flex-wrap: wrap;
- justify-content: center;
+ letter-spacing: 0.08em;
margin-bottom: 8px;
}
-
+.tutorial-container .tutorial-title {
+ margin: 0 0 8px;
+ color: var(--tt-text);
+ font-size: 32px;
+ font-weight: 650;
+ line-height: 1.3;
+}
+.tutorial-container .tutorial-subtitle {
+ margin: 0;
+ color: var(--tt-secondary);
+ font-size: 14px;
+ line-height: 1.7;
+}
+.tutorial-container .tutorial-close-btn {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+ width: 32px;
+ height: 32px;
+ padding: 0;
+ color: var(--tt-secondary);
+}
+.tutorial-close-btn .ant-btn-icon {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ line-height: 0;
+}
+.tutorial-close-btn svg {
+ display: block;
+}
+.tutorial-main-tabs > .ant-tabs-nav {
+ margin-bottom: 24px;
+}
+.tutorial-tab-label-main,
+.tutorial-tab-label {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+}
+.tutorial-scroll-wrapper {
+ display: grid;
+ grid-template-columns: 208px minmax(0, 1fr);
+ align-items: start;
+ gap: 28px;
+}
+.tutorial-quick-nav {
+ position: sticky;
+ top: calc(var(--console-header-offset, 72px) + 24px);
+ padding: 16px 12px;
+ border: 1px solid var(--tt-border);
+ border-radius: 12px;
+ background: var(--tt-surface);
+}
+.tutorial-directory-title {
+ padding: 0 12px;
+ margin-bottom: 16px;
+}
+.tutorial-quick-nav-inner {
+ display: grid;
+ gap: 8px;
+}
.tutorial-quick-nav-item {
display: flex;
align-items: center;
- gap: 5px;
- padding: 6px 12px;
- border-radius: 16px;
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 8%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 5%, transparent)
- );
- color: var(--ui-color-text-0);
+ gap: 10px;
+ padding: 10px 12px;
+ color: var(--tt-secondary);
+ border-radius: 8px;
+ font-size: 14px;
text-decoration: none;
- font-size: 12px;
- font-weight: 500;
- transition: all 0.3s ease;
- border: 1px solid transparent;
}
-
-.tutorial-quick-nav-item:hover {
- background: linear-gradient(135deg, var(--step-color), var(--step-color));
- color: white;
- transform: translateY(-2px);
- box-shadow: 0 4px 12px
- color-mix(in srgb, var(--brand-primary) 25%, transparent);
+.tutorial-quick-nav-item:hover,
+.tutorial-quick-nav-item.active {
+ color: var(--tt-accent);
+ background: var(--tt-soft);
}
-
-.tutorial-quick-nav-number {
- width: 18px;
- height: 18px;
- display: flex;
- align-items: center;
- justify-content: center;
- background: var(--step-color);
- color: white;
- border-radius: 50%;
- font-size: 10px;
+.tutorial-quick-nav-item.active {
font-weight: 600;
}
-
-.tutorial-quick-nav-item:hover .tutorial-quick-nav-number {
- background: rgba(255, 255, 255, 0.3);
+.tutorial-quick-nav-number,
+.tutorial-step-number {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+ width: 26px;
+ height: 26px;
+ border: 1px solid var(--tt-border);
+ border-radius: 8px;
+ font-size: 12px;
+ font-variant-numeric: tabular-nums;
+}
+.tutorial-quick-nav-item.active .tutorial-quick-nav-number {
+ border-color: var(--tt-accent);
}
-
.tutorial-scroll-hint {
display: flex;
- align-items: center;
- justify-content: center;
gap: 8px;
- color: var(--ui-color-text-2);
- font-size: 13px;
+ margin: 20px 12px 0;
+ padding-top: 16px;
+ border-top: 1px solid var(--tt-border);
+ color: var(--tt-secondary);
+ font-size: 12px;
+ line-height: 1.6;
}
-
-.tutorial-scroll-hint-icon {
- animation: scrollHintBounce 1.5s ease-in-out infinite;
- font-size: 16px;
-}
-
-@keyframes scrollHintBounce {
- 0%,
- 100% {
- transform: translateY(0);
- }
- 50% {
- transform: translateY(4px);
- }
-}
-
-/* 滚动容器 */
+/* Content follows its natural height; only the shared page scrolls. */
.tutorial-scroll-container {
- flex: 1;
- overflow-y: auto;
- overflow-x: hidden;
- padding: 0 4px;
- scroll-behavior: smooth;
- /* 确保滚动条始终可见;配色统一走 --brand-scroll token(随主题/品牌色切换) */
+ min-width: 0;
}
-
-/* WebKit 滚动条样式 */
-.tutorial-scroll-container::-webkit-scrollbar {
- width: 8px;
-}
-
-.tutorial-scroll-container::-webkit-scrollbar-track {
- background: transparent;
- border-radius: 4px;
-}
-
-.tutorial-scroll-container::-webkit-scrollbar-thumb {
- background: var(--brand-scroll);
- border-radius: 4px;
-}
-
-.tutorial-scroll-container::-webkit-scrollbar-thumb:hover {
- background: var(--brand-scroll-hover);
-}
-
-/* 所有步骤容器 */
.tutorial-all-steps {
- display: flex;
- flex-direction: column;
- gap: 32px;
+ display: grid;
+ gap: 24px;
}
-
-/* 单个步骤区块 */
.tutorial-step-section {
- scroll-margin-top: 20px;
+ min-width: 0;
+ padding: 28px;
+ border: 1px solid var(--tt-border);
+ border-radius: 12px;
+ background: var(--tt-surface);
+ scroll-margin-top: calc(var(--console-header-offset, 72px) + 24px);
}
-
-/* 步骤分隔线 */
.tutorial-step-divider {
- display: flex;
- align-items: center;
- justify-content: center;
margin-bottom: 16px;
}
-
.tutorial-step-badge {
- padding: 6px 16px;
- border-radius: 20px;
- color: white;
+ color: var(--tt-accent);
font-size: 12px;
font-weight: 600;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
+ font-variant-numeric: tabular-nums;
+ letter-spacing: 0.08em;
}
-
-/* 底部完成区域 */
-.tutorial-scroll-end {
+.tutorial-step-content {
+ display: grid;
+ gap: 20px;
+ min-width: 0;
+}
+.tutorial-step-header {
+ display: flex;
+ align-items: flex-start;
+ gap: 14px;
+}
+.tutorial-step-icon {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+ width: 44px;
+ height: 44px;
+ border-radius: 10px;
+ background: var(--tt-soft);
+ color: var(--tt-accent);
+}
+.tutorial-step-header h3.ant-typography {
+ margin: 0 0 6px;
+ font-size: 21px;
+ line-height: 1.45;
+}
+.tutorial-step-header .ant-typography {
+ margin-bottom: 0;
+}
+.tutorial-container .tutorial-card.ant-card {
+ border: 1px solid var(--tt-border);
+ border-radius: 8px;
+ box-shadow: none;
+ min-width: 0;
+}
+.tutorial-card > .ant-card-body {
+ padding: 20px;
+}
+.tutorial-steps-list {
+ display: grid;
+ gap: 0;
+}
+.tutorial-step-item {
+ display: flex;
+ align-items: flex-start;
+ gap: 12px;
+ padding: 12px 0;
+ line-height: 1.8;
+ color: var(--tt-text);
+}
+.tutorial-step-item:first-child {
+ padding-top: 0;
+}
+.tutorial-step-item:last-child {
+ padding-bottom: 0;
+}
+.tutorial-step-item + .tutorial-step-item {
+ border-top: 1px solid var(--tt-border);
+}
+.tutorial-step-number {
+ color: var(--tt-secondary);
+ background: var(--tt-muted);
+}
+.tutorial-link {
+ color: var(--tt-accent);
+ text-decoration: underline;
+ text-underline-offset: 3px;
+}
+.tutorial-warning-card,
+.tutorial-tip-card,
+.tutorial-info-card {
+ background: var(--tt-muted);
+}
+.tutorial-warning-content,
+.tutorial-tip-content,
+.tutorial-info-content {
+ display: flex;
+ align-items: flex-start;
+ gap: 12px;
+}
+.tutorial-warning-content > div,
+.tutorial-tip-content > div,
+.tutorial-info-content > div {
+ min-width: 0;
+}
+.tutorial-key-example {
+ display: block;
+ margin-top: 12px;
+ overflow-wrap: anywhere;
+}
+.tutorial-model-tags {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px;
+ margin-top: 12px;
+}
+.tutorial-action-buttons {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 12px;
+}
+.tutorial-code-block {
+ min-width: 0;
+ margin-top: 12px;
+ background: var(--tt-muted);
+ border: 1px solid var(--tt-border);
+ border-radius: 8px;
+}
+.tutorial-code-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 12px;
+ padding: 10px 14px;
+ border-bottom: 1px solid var(--tt-border);
+}
+.tutorial-code-content {
+ margin: 0;
+ padding: 16px;
+ white-space: pre-wrap;
+ overflow-wrap: anywhere;
+ line-height: 1.8;
+ font-size: 13px;
+ color: var(--tt-text);
+}
+.tutorial-tab-content {
+ padding-top: 8px;
+}
+.tutorial-commands-grid {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 12px;
+}
+.tutorial-command-item {
+ display: grid;
+ gap: 8px;
+ padding: 16px;
+ background: var(--tt-muted);
+ border-radius: 8px;
+}
+.tutorial-command-item code {
+ color: var(--tt-accent);
+ overflow-wrap: anywhere;
+}
+.tutorial-command-item span {
+ color: var(--tt-secondary);
+ font-size: 13px;
+}
+.tutorial-completion-card {
+ padding: 24px;
+ background: var(--tt-soft);
+ border-radius: 8px;
text-align: center;
- padding: 48px 24px;
- margin-top: 32px;
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 5%, transparent),
- color-mix(in srgb, var(--brand-primary) 5%, transparent)
- );
- border-radius: 20px;
- border: 1px dashed color-mix(in srgb, var(--brand-primary) 20%, transparent);
}
-
+.tutorial-completion-icon {
+ font-size: 32px;
+ margin-bottom: 12px;
+}
+.tutorial-explore-grid {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 12px;
+}
+.tutorial-explore-card {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 16px;
+ border: 1px solid var(--tt-border);
+ border-radius: 8px;
+ color: var(--tt-text);
+}
+.tutorial-explore-card:hover {
+ border-color: var(--tt-accent);
+ background: var(--tt-soft);
+}
+.tutorial-explore-content {
+ flex: 1;
+ min-width: 0;
+}
+.tutorial-explore-content .ant-typography {
+ font-size: 13px;
+}
+.tutorial-explore-icon {
+ font-size: 24px;
+}
+.tutorial-explore-arrow {
+ flex-shrink: 0;
+ color: var(--tt-accent);
+}
+.tutorial-scroll-end {
+ margin-top: 24px;
+ padding: 24px;
+ text-align: center;
+ border-top: 1px solid var(--tt-border);
+}
.tutorial-scroll-end-icon {
- font-size: 48px;
- margin-bottom: 16px;
- animation: celebrateIcon 2s ease-in-out infinite;
+ font-size: 28px;
+ margin-bottom: 12px;
+}
+.tutorial-container :is(a, button, section):focus-visible {
+ outline: 2px solid var(--tt-accent);
+ outline-offset: 4px;
}
-@keyframes celebrateIcon {
- 0%,
- 100% {
- transform: scale(1) rotate(0deg);
- }
- 25% {
- transform: scale(1.1) rotate(-5deg);
- }
- 75% {
- transform: scale(1.1) rotate(5deg);
- }
-}
-
-/* 深色模式 */
-html.dark .tutorial-quick-nav {
- background: linear-gradient(
- 135deg,
- rgba(30, 30, 40, 0.95),
- rgba(25, 25, 35, 0.9)
- );
- border-color: color-mix(in srgb, var(--brand-primary) 20%, transparent);
-}
-
-html.dark .tutorial-quick-nav-item {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 15%, transparent),
- color-mix(in srgb, var(--brand-gradient-via) 10%, transparent)
- );
-}
-
-/* 暗色分支不再单独配色:--brand-scroll token 自带亮暗两套定义,自动跟随 */
-
-html.dark .tutorial-scroll-end {
- background: linear-gradient(
- 135deg,
- color-mix(in srgb, var(--brand-primary) 10%, transparent),
- color-mix(in srgb, var(--brand-primary) 10%, transparent)
- );
- border-color: color-mix(in srgb, var(--brand-primary) 30%, transparent);
-}
-
-/* 响应式 */
-@media (max-width: 768px) {
+@media (max-width: 900px) {
.tutorial-scroll-wrapper {
- height: calc(100vh - 220px);
- min-height: 400px;
+ grid-template-columns: minmax(0, 1fr);
+ gap: 16px;
}
-
.tutorial-quick-nav {
- padding: 8px 12px;
+ position: static;
+ padding: 16px;
+ }
+ .tutorial-directory-title {
+ padding: 0;
+ margin-bottom: 12px;
}
-
.tutorial-quick-nav-inner {
- gap: 4px;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ gap: 8px;
}
-
.tutorial-quick-nav-item {
- /* 触控下限 32px。原 5px/8px 配 16px 数字圆点只有 32x26 */
- padding: 8px 10px;
- min-height: 32px;
- font-size: 11px;
+ padding: 8px;
+ font-size: 13px;
+ gap: 8px;
}
-
- .tutorial-quick-nav-number {
- width: 16px;
- height: 16px;
- font-size: 9px;
- }
-
- /* 保留标题:只留数字圆点时用户无法判断每一项通向哪里。
- .tutorial-quick-nav-inner 已可横向滚动,放得下文字。 */
- .tutorial-quick-nav-title {
- display: inline;
- font-size: 11px;
- }
-
- .tutorial-all-steps {
- gap: 24px;
+ .tutorial-scroll-hint {
+ margin: 12px 0 0;
+ padding-top: 12px;
+ }
+}
+@media (max-width: 600px) {
+ .tutorial-container {
+ padding: 20px 16px 32px;
+ padding-top: calc(
+ var(--console-header-offset, 56px) - var(--content-top-offset, 0px) + 20px
+ );
+ }
+ .tutorial-header {
+ gap: 16px;
+ margin-bottom: 20px;
+ }
+ .tutorial-container .tutorial-title {
+ font-size: 28px;
+ }
+ .tutorial-close-btn {
+ margin-left: auto;
+ }
+ .tutorial-quick-nav-inner {
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ }
+ .tutorial-step-section {
+ padding: 20px 16px;
+ scroll-margin-top: calc(var(--console-header-offset, 56px) + 20px);
+ }
+ .tutorial-step-content {
+ gap: 16px;
+ }
+ .tutorial-step-header {
+ gap: 12px;
+ }
+ .tutorial-step-header h3.ant-typography {
+ font-size: 18px;
+ }
+ .tutorial-step-icon {
+ width: 36px;
+ height: 36px;
+ }
+ .tutorial-card > .ant-card-body {
+ padding: 16px;
+ }
+ .tutorial-commands-grid,
+ .tutorial-explore-grid {
+ grid-template-columns: minmax(0, 1fr);
+ }
+ .tutorial-code-content {
+ padding: 12px;
}
}
diff --git a/src/pages/UserCenter/Invite.jsx b/src/pages/UserCenter/Invite.jsx
index 6418d217..583d8013 100644
--- a/src/pages/UserCenter/Invite.jsx
+++ b/src/pages/UserCenter/Invite.jsx
@@ -23,6 +23,7 @@ import {
Copy as ActionCopy,
Link as ActionLink,
} from '@/components/common/icons/ActionIcons';
+import { formatPercent } from '../../helpers/safeDisplay';
import React, { useState, useEffect, useContext, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import {
@@ -327,7 +328,7 @@ const Invite = () => {
title: t('返佣比例'),
dataIndex: 'rebate_rate',
key: 'rebate_rate',
- render: (text) => `${((text || 0) * 100).toFixed(0)}%`,
+ render: (text) => formatPercent((Number(text) || 0) * 100, 0),
},
{
title: t('模型'),
@@ -429,7 +430,7 @@ const Invite = () => {
{item.label === t('\u9080\u8bf7\u4eba\u6570') &&
stats.rebate_rate > 0 && (
- {(stats.rebate_rate * 100).toFixed(0)}%
+ {formatPercent((Number(stats.rebate_rate) || 0) * 100, 0)}
)}
diff --git a/src/pages/UserCenter/Invoice.jsx b/src/pages/UserCenter/Invoice.jsx
index 731cd9fe..6d93cb83 100644
--- a/src/pages/UserCenter/Invoice.jsx
+++ b/src/pages/UserCenter/Invoice.jsx
@@ -50,6 +50,11 @@ import {
INVOICE_STATUS_COLOR,
} from '../../constants';
import { StatusContext } from '../../context/Status';
+import {
+ formatCurrency,
+ formatNumber,
+ toFiniteNumber,
+} from '../../helpers/safeDisplay';
const { Text } = Typography;
@@ -150,7 +155,7 @@ const Invoice = () => {
// 计算选中记录的金额合计
const selectedAmount = availableTopups
.filter((t) => selectedTopupIds.includes(t.id))
- .reduce((sum, t) => sum + (t.money || 0), 0);
+ .reduce((sum, t) => sum + (toFiniteNumber(t.money) ?? 0), 0);
// 选择常用开票信息
const handleSelectTitle = (titleId) => {
@@ -315,7 +320,7 @@ const Invoice = () => {
title: t('支付金额'),
dataIndex: 'money',
width: 100,
- render: (v) => (v ? `¥${Number(v).toFixed(2)}` : '-'),
+ render: (v) => formatCurrency(v),
},
{
title: t('订单号'),
@@ -343,7 +348,7 @@ const Invoice = () => {
title: t('开票金额'),
dataIndex: 'amount',
width: 100,
- render: (v) => `¥${Number(v).toFixed(2)}`,
+ render: (v) => formatCurrency(v),
},
{
title: t('状态'),
@@ -449,7 +454,7 @@ const Invoice = () => {