/* ============================================
   莫小派工作台设计系统
   Modern Professional · 深林绿主题 · Bento 风格
   ============================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: var(--font-sans);
}

:root {
  /* ===== 颜色系统 - 基于参考设计系统 ===== */
  /* 主内容区背景 - 浅绿色调 (参考: --background: 150 20% 97%) */
  --bg: hsl(150, 20%, 97%);
  --bg-gradient: linear-gradient(to bottom, hsl(150, 20%, 97%) 0%, hsl(0, 0%, 100%) 100%);

  /* 白色表面 */
  --surface: hsl(0, 0%, 100%);
  --surface-hover: hsl(150, 15%, 95%);
  --surface-tint: hsl(150, 20%, 98%);

  /* 文字层级 (参考: --foreground: 150 10% 15%) */
  --text: hsl(150, 10%, 15%);
  /* 主标题 - 深灰色 */
  --text-secondary: hsl(150, 10%, 40%);
  /* 次要文字 - 中灰色 */
  --text-muted: hsl(150, 10%, 55%);
  /* 辅助文字 - 浅灰色 */

  /* 导航栏 - 深绿色主题 (参考: --sidebar-background: 158 30% 20%) */
  --sidebar-bg: hsl(158, 30%, 20%);
  --sidebar-text: hsl(0, 0%, 70%);
  /* 未选中导航项文字 - 浅灰色 */
  --sidebar-text-hover: hsl(0, 0%, 100%);
  /* 导航项hover文字 - 白色 */
  --sidebar-active-bg: hsl(158, 40%, 30%);
  /* 选中导航项背景 (参考: --sidebar-accent: 158 40% 30%) */
  --sidebar-active-text: hsl(0, 0%, 100%);
  /* 选中导航项文字 - 白色 */

  /* 强调色 - 绿色系 (参考: --primary: 158 64% 40%, --accent: 158 50% 92%) */
  --accent: hsl(158, 64%, 50%);
  /* 主要强调色 - 亮绿色（图标、链接、指示点） */
  --accent-hover: hsl(158, 64%, 45%);
  /* Hover状态 */
  --accent-soft: hsl(158, 50%, 92%);
  /* 卡片hover背景 (参考: --accent: 158 50% 92%) */
  --accent-light: hsl(158, 64%, 70%);
  /* 卡片内图标 - 浅绿色 */
  --accent-link: hsl(158, 64%, 45%);
  /* 链接文字 - 中等绿色 */

  /* 按钮和交互元素 (参考: --primary: 158 64% 40%) */
  --primary: hsl(158, 64%, 40%);
  /* 主按钮 */
  --primary-hover: hsl(158, 64%, 35%);
  /* 主按钮hover */
  --primary-foreground: hsl(0, 0%, 100%);
  /* 主按钮文字颜色 - 白色 */

  /* 兼容变量 */
  --accent-badge: hsl(158, 64%, 50%);
  --accent-ultra-soft: hsl(158, 50%, 95%);

  /* 边框和分隔线 (参考: --border: 150 15% 85%) */
  --border: hsl(150, 15%, 85%);
  --border-light: hsl(150, 15%, 90%);
  --divider: hsl(150, 10%, 92%);

  /* 阴影系统 (参考设计系统) */
  --shadow-sm: 0 1px 3px 0px hsl(150 10% 0% / 0.08), 0 1px 2px -1px hsl(150 10% 0% / 0.08);
  --shadow-md: 0 4px 6px -1px hsl(150 10% 0% / 0.1), 0 2px 4px -1px hsl(150 10% 0% / 0.06);
  --shadow-lg: 0 10px 15px -3px hsl(150 10% 0% / 0.1), 0 4px 6px -2px hsl(150 10% 0% / 0.05);
  --shadow-focus: 0 0 0 4px hsl(158 50% 92% / 0.5);
  --shadow-card: 0 1px 3px 0px hsl(150 10% 0% / 0.08), 0 1px 2px -1px hsl(150 10% 0% / 0.08);

  /* 圆角系统 (参考: --radius: 0.75rem = 12px) */
  --radius-sm: 6px;
  --radius-md: 12px;
  /* 主要圆角 (参考设计) */
  --radius-lg: 16px;
  /* 卡片圆角 */
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* ===== 间距 ===== */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 40px;
  --space-4xl: 48px;

  /* ===== 排版 (参考设计系统字体) ===== */
  --font-sans: 'Inter', 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-heading: 'Lora', 'Merriweather', Georgia, 'Times New Roman', serif;
  --font-mono: 'Inconsolata', 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --line-height-tight: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;
}

/* ===== 通用组件：按钮系统 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 主按钮 - 绿色主题 */
.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* 次级按钮 - 白底带边框（参考图的 Upcoming Events） */
.btn-secondary {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--surface-hover);
  border-color: var(--text-secondary);
}

/* 绿色强调按钮（用于需要特别强调的操作） */
.btn-accent {
  background-color: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Ghost 按钮 - 透明底 */
.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background-color: var(--surface-hover);
  color: var(--text);
}

/* 小尺寸按钮 */
.btn-sm {
  padding: var(--space-sm) var(--space-lg);
  font-size: 13px;
}

/* 按钮 active 状态 */
.btn:active:not(:disabled) {
  transform: translateY(0);
}

/* ===== 通用组件：徽章/标签 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge-soft {
  background-color: var(--accent-soft);
  color: var(--accent-hover);
}

.badge-neutral {
  background-color: var(--border-light);
  color: var(--text-secondary);
}

.badge-outline {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ===== 通用组件：卡片 ===== */
.card-minimal {
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-minimal:hover {
  border-color: var(--text-muted);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-minimal:active {
  transform: translateY(-1px);
}

.card-minimal:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== 通用组件：导航 Pill（侧边栏选中态） ===== */
.nav-pill {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-pill:hover {
  background-color: var(--surface-hover);
  color: var(--text);
}

.nav-pill:active {
  transform: scale(0.98);
}

.nav-pill.active {
  background-color: hsl(158, 40%, 30%);
  color: hsl(0, 0%, 100%);
  font-weight: 500;
  position: relative;
}

.nav-pill.active::after {
  content: '';
  position: absolute;
  right: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
}

.nav-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== 通用组件：输入框 ===== */
.input-minimal,
.textarea-minimal {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-size: 14px;
  line-height: var(--line-height-normal);
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.input-minimal:focus,
.textarea-minimal:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.input-minimal::placeholder,
.textarea-minimal::placeholder {
  color: var(--text-muted);
}

.textarea-minimal {
  resize: vertical;
  min-height: 120px;
}

/* ===== 通用组件：Focus Ring（键盘可访问性） ===== */
/* 
  确保键盘用户可以清晰看到焦点位置
  使用 :focus-visible 避免鼠标点击时显示 outline
  颜色对比度符合 WCAG AA 标准（4.5:1 for normal text, 3:1 for large text）
*/
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== 通用布局：容器 ===== */
.container-centered {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-3xl);
  padding-right: var(--space-3xl);
}

/* ===== Typography Hierarchy (Stronger Contrast) ===== */
.heading-hero {
  font-family: var(--font-heading);
  font-size: 56px;
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--text);
  letter-spacing: -0.02em;
}

.heading-xl {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--text);
}

.heading-lg {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 600;
  line-height: var(--line-height-normal);
  color: var(--text);
}

.heading-md {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  line-height: var(--line-height-normal);
  color: var(--text);
}

.text-accent {
  color: var(--accent-hover);
}

.text-muted {
  color: var(--text-secondary);
}

.text-soft {
  color: var(--text-muted);
}

/* ===== 无障碍：减少动画（Reduced Motion） ===== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 通用组件：步骤条 (Stepper) ===== */
.stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-3xl);
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  width: 100%;
  height: 2px;
  background-color: var(--border);
  z-index: 0;
}

.step.active:not(:last-child)::after,
.step.completed:not(:last-child)::after {
  background-color: var(--primary);
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--border-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.step.active .step-number {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary-hover);
}

.step.completed .step-number {
  background-color: var(--accent);
  color: white;
}

.step-label {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.step.active .step-label {
  color: var(--primary);
  font-weight: 600;
}

/* ===== 通用组件：消息气泡 & 聊天容器 ===== */
.chat-container {
  display: none;
  margin-top: var(--space-2xl);
  padding: var(--space-xl);
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  min-height: 400px;
}

.chat-container.show {
  display: block;
  animation: fadeIn 0.5s;
}

.chat-message {
  margin-bottom: 20px;
  animation: slideUp 0.5s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-bubble {
  display: block;
  width: 100%;
  padding: 0;
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  padding-bottom: var(--space-lg);
  border-bottom: none !important;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--surface-tint);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  overflow: hidden;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.message-name {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.message-content {
  font-size: 14px;
  color: var(--text);
  line-height: var(--line-height-relaxed);
  padding-top: var(--space-lg);
}

/* ===== 通用组件：加载动画 ===== */
.loading-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.loading-dots {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
  animation: loadingBounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes loadingBounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

/* ===== 通用组件：AI 操作按钮 ===== */
.ai-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--divider);
}

.ai-action-btn {
  padding: 8px 12px;
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-action-btn svg {
  width: 16px;
  height: 16px;
}

.ai-action-btn:hover {
  background-color: var(--surface-hover);
  border-color: var(--text-muted);
  color: var(--text);
}

.ai-action-btn.primary {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.ai-action-btn.primary:hover {
  background-color: var(--primary-hover);
}

.ai-action-btn.liked {
  background-color: var(--accent-soft);
  color: var(--accent-hover);
  border-color: var(--accent);
}

.ai-action-btn.disliked {
  background-color: #fee;
  color: #c00;
  border-color: #fcc;
}

/* ===== 通用组件：质量检测结果 ===== */
.quality-result {
  display: none;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
  padding: var(--space-xl);
  background-color: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  animation: fadeIn 0.5s;
  position: relative;
}

.quality-result.show {
  display: block;
}

.quality-result.excellent {
  border-color: var(--accent);
  border-left-width: 3px;
  background-color: var(--surface);
}

.quality-result.good {
  border-color: #f59e0b;
  border-left-width: 3px;
  background-color: var(--surface);
}

.quality-result.poor {
  border-color: #f87171;
  border-left-width: 3px;
  background-color: var(--surface);
}

.quality-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--space-lg);
}

.quality-score {
  font-size: 32px;
  font-weight: 700;
}

.quality-result.excellent .quality-score {
  color: var(--accent-hover);
}

.quality-result.good .quality-score {
  color: #f59e0b;
}

.quality-result.poor .quality-score {
  color: #dc2626;
}

.quality-label {
  font-size: 18px;
  font-weight: 600;
}

.quality-close-btn {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 28px;
  height: 28px;
  border: none;
  background-color: transparent;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

.quality-close-btn:hover {
  background-color: var(--surface-hover);
  color: var(--text);
}

/* ===== 通用组件：Markdown/Prose 样式 ===== */
.prose {
  font-size: 14px;
  color: var(--text);
  line-height: var(--line-height-relaxed);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  font-family: var(--font-sans);
  /* 使用默认字体，与正文保持一致 */
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  font-weight: 600;
  color: var(--text);
  line-height: var(--line-height-tight);
}

.prose h1 {
  font-size: 28px;
  border-bottom: 2px solid var(--divider);
  padding-bottom: var(--space-sm);
}

.prose h2 {
  font-size: 22px;
  border-bottom: 1px solid var(--divider);
  padding-bottom: var(--space-xs);
}

.prose h3 {
  font-size: 18px;
}

.prose h4 {
  font-size: 16px;
}

.prose p {
  margin: var(--space-md) 0;
}

.prose ul,
.prose ol {
  margin: var(--space-md) 0;
  padding-left: 28px;
}

.prose li {
  margin: var(--space-xs) 0;
}

.prose strong {
  font-weight: 600;
  color: var(--text);
}

.prose em {
  font-style: italic;
}

.prose code {
  background-color: hsl(150, 10%, 92%);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: hsl(158, 64%, 40%);
  border: 1px solid hsl(150, 15%, 90%);
}

.prose pre {
  background-color: hsl(150, 10%, 92%);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-lg) 0;
  border: 1px solid hsl(150, 15%, 90%);
}

.prose pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
}

.prose blockquote {
  border-left: 4px solid hsl(158, 64%, 40%);
  padding-left: var(--space-lg);
  margin: var(--space-lg) 0;
  color: hsl(150, 10%, 40%);
  font-style: italic;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: var(--space-xl) 0;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--space-lg) 0;
}

.prose table th,
.prose table td {
  border: 1px solid var(--border);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
}

.prose table th {
  background-color: var(--surface-tint);
  font-weight: 600;
}

/* ===== 书签功能样式 ===== */

/* 自动跳过开关容器 */
.auto-skip-control {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

/* Toggle 开关 */
.auto-skip-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.auto-skip-toggle input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
}

.auto-skip-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  border-radius: 13px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auto-skip-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.auto-skip-toggle input:checked + .auto-skip-slider {
  background-color: var(--accent);
}

.auto-skip-toggle input:checked + .auto-skip-slider::before {
  transform: translateX(22px);
}

.auto-skip-toggle input:focus + .auto-skip-slider {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 开关标签 */
.auto-skip-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  user-select: none;
}

/* 信息按钮 */
.auto-skip-info-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  background-color: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auto-skip-info-btn:hover {
  background-color: var(--surface-hover);
  color: var(--accent);
}

.auto-skip-info-btn i {
  width: 18px;
  height: 18px;
}

/* 保存为书签按钮 */
.step-bookmark-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-bookmark-btn.bookmarked {
  background-color: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.step-bookmark-btn.bookmarked:hover {
  background-color: var(--accent);
  color: white;
}

/* 从书签恢复的步骤样式 */
.step.from-bookmark {
  position: relative;
}

.step.from-bookmark::before {
  content: '📑';
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 18px;
  z-index: 10;
  animation: bookmarkBounce 0.6s ease-out;
}

@keyframes bookmarkBounce {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* 从书签恢复的内容区域 */
.step-content.from-bookmark {
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, transparent 100%);
  position: relative;
}

.step-content.from-bookmark::before {
  content: '📑 来自书签';
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  padding: 4px 12px;
  background-color: var(--accent-soft);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

/* ===== 响应式断点工具 ===== */
@media (max-width: 768px) {
  .container-centered {
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
  }

  .heading-hero {
    font-size: 36px;
  }

  .heading-xl {
    font-size: 28px;
  }

  .stepper {
    flex-direction: column;
  }

  .step::after {
    display: none !important;
  }

  .auto-skip-control {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ============================================
   设置界面 (Settings View) - Premium 重构版
   ============================================ */
/* ============================================
   账户设置 (Settings V2) - 均衡专业版
   ============================================ */
.settings-container-v2 {
  padding: var(--space-3xl);
  max-width: 1040px;
  margin: 0 auto;
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 顶部个人资料页头 */
.settings-top-header {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  margin-bottom: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.name-meta h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.id-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-tint);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.plan-badge-wrapper {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  line-height: 1;
}

.plan-expiry {
  font-size: 11px;
  color: var(--text-muted);
}

/* 会员等级状态注入样式 (Badge & Theme) */
#settings-view[data-tier="premium"] .plan-badge {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  /* 琥珀/黄色 */
  color: #ffffff;
}

#settings-view[data-tier="standard"] .plan-badge {
  background: linear-gradient(135deg, #34d399, #059669);
  /* 绿色 */
  color: #ffffff;
}

.settings-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.box-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 使用统计模块 - 更加紧凑 */
.usage-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.u-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.u-stat label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.u-stat span {
  font-size: 20px;
  /* 统一字体大小，确保排版一致 */
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-sans);
  /* 换成 sans 使文本和数字更统一 */
}

/* 进度条 - V2 */
.usage-progress-v2 {
  background: var(--surface-secondary);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.progress-info b {
  color: var(--accent);
}

.bar-bg {
  height: 6px;
  background: var(--divider);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 移除冗余横幅 */
.premium-privilege {
  display: none !important;
}

/* 账号管理列表 */
.action-list-v2 {
  display: flex;
  flex-direction: column;
}

.action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
}

.action-txt h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.action-txt p {
  font-size: 12px;
  color: var(--text-muted);
}

.logout-btn-v2 {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  color: #dc3545;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn-v2:hover {
  background: #fff5f5;
  border-color: #feb2b2;
  transform: translateY(-1px);
}

.logout-btn-v2 i {
  width: 16px;
  height: 16px;
}

/* 更新主内容网格位置 */
.settings-main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

/* 响应式适配 */
@media (max-width: 768px) {
  .settings-main-content {
    grid-template-columns: 1fr;
  }

  .settings-top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-lg);
  }

  .plan-badge-wrapper {
    align-items: flex-start;
    text-align: left;
  }
}

/* ============================================
   自定义确认对话框 (Global)
   ============================================ */
.confirm-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  /* 确保在最上层 */
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.confirm-dialog-overlay.show {
  display: flex !important;
}

.confirm-dialog {
  width: 90%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 32px;
  animation: modalSlideIn 0.3s ease-out;
  font-family: var(--font-sans);
}

.confirm-dialog-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.confirm-dialog-message {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}

.confirm-dialog-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.confirm-dialog-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 80px;
}

.confirm-dialog-btn-primary {
  background-color: var(--accent);
  color: white;
}

.confirm-dialog-btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.confirm-dialog-btn-primary:active {
  transform: translateY(0);
}

.confirm-dialog-btn-secondary {
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.confirm-dialog-btn-secondary:hover {
  background-color: var(--surface-hover);
  border-color: var(--border-light);
}

/* 动画系统 */
@keyframes modalSlideIn {
  from {
    transform: translateY(20px) scale(0.98);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
