/**
 * StoryTree Component Styles
 * 组件样式文件 - 包含所有可复用组件的样式定义
 */

/* ========================================
   1. 按钮组件
   ======================================== */

/* 基础按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--st-space-2);
  padding: var(--st-space-3) var(--st-space-5);
  font-size: var(--st-text-base);
  font-weight: var(--st-font-semibold);
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--st-radius-lg);
  cursor: pointer;
  transition: all var(--st-duration-normal) var(--st-ease-default);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* 主要按钮 */
.btn-primary {
  background: var(--st-gradient-brand);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 12px -2px rgba(99, 102, 241, 0.3);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* 次要按钮 */
.btn-secondary {
  background: var(--st-bg-primary);
  color: var(--st-primary-600);
  border-color: var(--st-primary-200);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--st-primary-50);
  border-color: var(--st-primary-400);
  transform: translateY(-2px);
}

/* 文字按钮 */
.btn-text {
  background: transparent;
  color: var(--st-primary-600);
  padding: var(--st-space-2);
}

.btn-text:hover:not(:disabled) {
  background: var(--st-primary-50);
  color: var(--st-primary-700);
}

/* 危险按钮 */
.btn-danger {
  background: var(--st-error-500);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: var(--st-error-600);
  transform: translateY(-2px);
}

/* 成功按钮 */
.btn-success {
  background: var(--st-success-500);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: var(--st-success-600);
  transform: translateY(-2px);
}

/* 幽灵按钮 */
.btn-ghost {
  background: transparent;
  color: var(--st-text-secondary);
  border-color: var(--st-gray-300);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--st-gray-100);
  color: var(--st-text-primary);
}

/* 按钮尺寸 */
.btn-sm {
  padding: var(--st-space-2) var(--st-space-3);
  font-size: var(--st-text-sm);
  border-radius: var(--st-radius-md);
}

.btn-lg {
  padding: var(--st-space-4) var(--st-space-6);
  font-size: var(--st-text-lg);
  border-radius: var(--st-radius-xl);
}

/* 图标按钮 */
.btn-icon {
  padding: var(--st-space-2);
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--st-radius-md);
}

.btn-icon.btn-sm {
  min-width: 32px;
  min-height: 32px;
}

.btn-icon.btn-lg {
  min-width: 48px;
  min-height: 48px;
}

/* 块级按钮 */
.btn-block {
  width: 100%;
}

/* 按钮组 */
.btn-group {
  display: inline-flex;
  gap: var(--st-space-2);
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--st-radius-lg) 0 0 var(--st-radius-lg);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--st-radius-lg) var(--st-radius-lg) 0;
}

/* 问号提示按钮（全局统一样式） */
.help-hint-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  border-radius: 50% !important;
  border: 1px solid var(--st-gray-400, #aaa);
  background: transparent;
  color: var(--st-text-tertiary, #999);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 !important;
  line-height: 1;
  margin-left: 4px;
  vertical-align: super;
  flex-shrink: 0;
  transition: all 0.2s;
  box-sizing: border-box;
}

.help-hint-btn:hover {
  border-color: var(--st-primary-500);
  color: white;
  background: var(--st-primary-500);
}

/* ========================================
   2. 卡片组件
   ======================================== */

/* 基础卡片 */
.card {
  background: var(--st-bg-primary);
  border-radius: var(--st-radius-xl);
  padding: var(--st-space-6);
  box-shadow: var(--st-shadow-md);
  border: 1px solid var(--st-gray-100);
  transition: all var(--st-duration-slow) var(--st-ease-default);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--st-shadow-xl);
}

.card-header {
  margin-bottom: var(--st-space-4);
}

.card-title {
  font-size: var(--st-text-xl);
  font-weight: var(--st-font-semibold);
  color: var(--st-text-primary);
  margin-bottom: var(--st-space-2);
}

.card-subtitle {
  font-size: var(--st-text-sm);
  color: var(--st-text-tertiary);
}

.card-body {
  color: var(--st-text-secondary);
}

.card-footer {
  margin-top: var(--st-space-4);
  padding-top: var(--st-space-4);
  border-top: 1px solid var(--st-gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 故事卡片 */
.story-card {
  background: var(--st-bg-primary);
  border-radius: var(--st-radius-xl);
  overflow: hidden;
  box-shadow: var(--st-shadow-md);
  transition: all var(--st-duration-slow) var(--st-ease-bounce);
  cursor: pointer;
  border: 1px solid var(--st-gray-100);
}

.story-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--st-shadow-xl);
}

.story-card-cover {
  height: 200px;
  background: var(--st-gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.story-card-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
}

.story-card-badge {
  position: absolute;
  top: var(--st-space-3);
  right: var(--st-space-3);
  background: rgba(255, 255, 255, 0.95);
  color: var(--st-primary-600);
  padding: var(--st-space-1) var(--st-space-3);
  border-radius: var(--st-radius-full);
  font-size: var(--st-text-xs);
  font-weight: var(--st-font-bold);
}

.story-card-content {
  padding: var(--st-space-5);
}

.story-card-title {
  font-size: var(--st-text-lg);
  font-weight: var(--st-font-semibold);
  margin-bottom: var(--st-space-2);
  color: var(--st-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: var(--st-leading-snug);
}

.story-card-desc {
  font-size: var(--st-text-sm);
  color: var(--st-text-secondary);
  line-height: var(--st-leading-relaxed);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--st-space-3);
}

.story-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--st-space-3);
  border-top: 1px solid var(--st-gray-100);
  font-size: var(--st-text-sm);
  color: var(--st-text-tertiary);
}

.story-card-author {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
}

.story-card-stats {
  display: flex;
  gap: var(--st-space-3);
}

.story-card-stat {
  display: flex;
  align-items: center;
  gap: var(--st-space-1);
}

/* 用户卡片 */
.user-card {
  display: flex;
  align-items: center;
  gap: var(--st-space-3);
  padding: var(--st-space-4);
  background: var(--st-bg-primary);
  border-radius: var(--st-radius-lg);
  box-shadow: var(--st-shadow-sm);
  transition: all var(--st-duration-normal) var(--st-ease-default);
}

.user-card:hover {
  box-shadow: var(--st-shadow-md);
}

.user-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--st-radius-full);
  object-fit: cover;
}

.user-card-info {
  flex: 1;
  min-width: 0;
}

.user-card-name {
  font-weight: var(--st-font-semibold);
  color: var(--st-text-primary);
  margin-bottom: var(--st-space-1);
}

.user-card-meta {
  font-size: var(--st-text-sm);
  color: var(--st-text-tertiary);
}

/* ========================================
   3. 表单组件
   ======================================== */

/* 表单组 */
.form-group {
  margin-bottom: var(--st-space-5);
}

.form-label {
  display: block;
  margin-bottom: var(--st-space-2);
  font-size: var(--st-text-sm);
  font-weight: var(--st-font-medium);
  color: var(--st-text-primary);
}

.form-label-required::after {
  content: ' *';
  color: var(--st-error-500);
}

.form-help {
  margin-top: var(--st-space-1);
  font-size: var(--st-text-sm);
  color: var(--st-text-tertiary);
}

.form-error {
  margin-top: var(--st-space-1);
  font-size: var(--st-text-sm);
  color: var(--st-error-500);
  display: flex;
  align-items: center;
  gap: var(--st-space-1);
}

/* 输入框 */
.input {
  width: 100%;
  padding: var(--st-space-3) var(--st-space-4);
  font-size: var(--st-text-base);
  line-height: var(--st-leading-normal);
  color: var(--st-text-primary);
  background: var(--st-bg-primary);
  border: 2px solid var(--st-gray-200);
  border-radius: var(--st-radius-lg);
  transition: all var(--st-duration-fast) var(--st-ease-default);
}

.input:hover {
  border-color: var(--st-gray-300);
}

.input:focus {
  border-color: var(--st-primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input::placeholder {
  color: var(--st-gray-400);
}

.input:disabled {
  background: var(--st-gray-100);
  cursor: not-allowed;
  opacity: 0.7;
}

.input-error {
  border-color: var(--st-error-500);
}

.input-error:focus {
  border-color: var(--st-error-500);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* 输入框尺寸 */
.input-sm {
  padding: var(--st-space-2) var(--st-space-3);
  font-size: var(--st-text-sm);
}

.input-lg {
  padding: var(--st-space-4) var(--st-space-5);
  font-size: var(--st-text-lg);
}

/* 输入框组 */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .input {
  padding-left: var(--st-space-10);
}

.input-icon {
  position: absolute;
  left: var(--st-space-3);
  color: var(--st-gray-400);
  pointer-events: none;
  font-size: var(--st-text-lg);
}

.input-group .input-lg + .input-icon {
  font-size: var(--st-text-xl);
}

/* 文本域 */
.textarea {
  composes: input;
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: var(--st-leading-relaxed);
}

/* 选择框 */
.select {
  composes: input;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--st-space-3) center;
  background-size: 20px;
  padding-right: var(--st-space-10);
}

/* 复选框和单选框 */
.checkbox,
.radio {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
  cursor: pointer;
  font-size: var(--st-text-base);
  color: var(--st-text-primary);
}

.checkbox input,
.radio input {
  width: 18px;
  height: 18px;
  accent-color: var(--st-primary-500);
  cursor: pointer;
}

/* 开关 */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--st-gray-300);
  border-radius: var(--st-radius-full);
  transition: background var(--st-duration-normal) var(--st-ease-default);
}

.switch-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--st-bg-primary);
  border-radius: var(--st-radius-full);
  transition: transform var(--st-duration-normal) var(--st-ease-bounce);
  box-shadow: var(--st-shadow-sm);
}

.switch-input:checked + .switch-slider {
  background: var(--st-primary-500);
}

.switch-input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.switch-label {
  margin-left: var(--st-space-2);
  font-size: var(--st-text-sm);
  color: var(--st-text-secondary);
}

/* ========================================
   4. 徽章组件
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--st-space-1);
  padding: var(--st-space-1) var(--st-space-3);
  font-size: var(--st-text-xs);
  font-weight: var(--st-font-bold);
  border-radius: var(--st-radius-full);
  white-space: nowrap;
}

.badge-primary {
  background: var(--st-primary-100);
  color: var(--st-primary-700);
}

.badge-success {
  background: var(--st-success-100);
  color: var(--st-success-700);
}

.badge-warning {
  background: var(--st-warning-100);
  color: var(--st-warning-700);
}

.badge-error {
  background: var(--st-error-100);
  color: var(--st-error-700);
}

.badge-info {
  background: var(--st-info-100);
  color: var(--st-info-700);
}

.badge-gold {
  background: var(--st-gradient-gold);
  color: white;
}

.badge-outline {
  background: transparent;
  border: 1px solid currentColor;
}

/* ========================================
   5. 标签/Chip组件
   ======================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--st-space-1);
  padding: var(--st-space-2) var(--st-space-3);
  font-size: var(--st-text-sm);
  font-weight: var(--st-font-medium);
  color: var(--st-text-secondary);
  background: var(--st-gray-100);
  border: 1px solid transparent;
  border-radius: var(--st-radius-md);
  cursor: pointer;
  transition: all var(--st-duration-fast) var(--st-ease-default);
}

.chip:hover {
  background: var(--st-gray-200);
  color: var(--st-text-primary);
}

.chip.active {
  background: var(--st-primary-500);
  color: white;
  border-color: var(--st-primary-500);
}

.chip.active:hover {
  background: var(--st-primary-600);
}

.chip-removable {
  padding-right: var(--st-space-2);
}

.chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: var(--st-space-1);
  border-radius: var(--st-radius-full);
  background: rgba(0, 0, 0, 0.1);
  font-size: 10px;
  transition: background var(--st-duration-fast);
}

.chip-remove:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* ========================================
   6. 头像组件
   ======================================== */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--st-radius-full);
  background: var(--st-gradient-brand);
  color: white;
  font-weight: var(--st-font-bold);
  font-size: var(--st-text-base);
  overflow: hidden;
}

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

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: var(--st-text-sm);
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: var(--st-text-lg);
}

.avatar-xl {
  width: 80px;
  height: 80px;
  font-size: var(--st-text-2xl);
}

.avatar-bordered {
  border: 3px solid white;
  box-shadow: var(--st-shadow-md);
}

/* ========================================
   7. 导航组件
   ======================================== */

/* 主导航 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--st-gray-200);
  z-index: 1000;
  transition: box-shadow var(--st-duration-normal) var(--st-ease-default);
}

@media (prefers-color-scheme: dark) {
  .navbar {
    background: rgba(26, 26, 46, 0.95);
    border-bottom-color: var(--st-gray-200);
  }

  /* 卡片暗夜适配 */
  .card {
    border-color: var(--st-gray-200);
    box-shadow: var(--st-shadow-md);
  }

  .card-footer {
    border-top-color: var(--st-gray-200);
  }

  .story-card {
    border-color: var(--st-gray-200);
  }

  .story-card-badge {
    background: rgba(26, 26, 46, 0.9);
    color: var(--st-primary-400);
  }

  .story-card-meta {
    border-top-color: var(--st-gray-200);
  }

  .user-card {
    box-shadow: var(--st-shadow-sm);
  }

  /* 徽章暗夜适配 */
  .badge-primary {
    background: var(--st-primary-100);
    color: var(--st-primary-400);
  }

  .badge-success {
    background: var(--st-success-100);
    color: var(--st-success-400, var(--st-success-600));
  }

  .badge-warning {
    background: var(--st-warning-100);
    color: var(--st-warning-400, var(--st-warning-600));
  }

  .badge-error {
    background: var(--st-error-100);
    color: var(--st-error-400, var(--st-error-600));
  }

  .badge-info {
    background: var(--st-info-100);
    color: var(--st-info-400, var(--st-info-600));
  }

  /* Chip 暗夜适配 */
  .chip {
    background: var(--st-gray-100);
    color: var(--st-text-secondary);
  }

  .chip:hover {
    background: var(--st-gray-200);
    color: var(--st-text-primary);
  }

  .chip-remove {
    background: rgba(255, 255, 255, 0.1);
  }

  .chip-remove:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  /* 骨架屏暗夜适配 */
  .skeleton {
    background: linear-gradient(
      90deg,
      var(--st-gray-100) 25%,
      var(--st-gray-200) 50%,
      var(--st-gray-100) 75%
    );
    background-size: 200% 100%;
  }

  /* 输入框暗夜适配 */
  .input {
    background: var(--st-bg-primary);
    border-color: var(--st-gray-200);
  }

  .input:focus {
    border-color: var(--st-primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  }

  .input:disabled {
    background: var(--st-gray-100);
  }

  /* 次要按钮暗夜适配 */
  .btn-secondary {
    background: var(--st-bg-primary);
    color: var(--st-primary-400);
    border-color: var(--st-primary-700);
  }

  .btn-secondary:hover:not(:disabled) {
    background: var(--st-primary-100);
    border-color: var(--st-primary-500);
  }

  .btn-ghost {
    color: var(--st-text-secondary);
    border-color: var(--st-gray-300);
  }

  .btn-ghost:hover:not(:disabled) {
    background: var(--st-gray-100);
    color: var(--st-text-primary);
  }

  .btn-text {
    color: var(--st-primary-400);
  }

  .btn-text:hover:not(:disabled) {
    background: var(--st-primary-100);
  }

  /* 面包屑暗夜适配 */
  .breadcrumb-separator {
    color: var(--st-gray-400);
  }

  /* 标签页暗夜适配 */
  .tabs {
    border-bottom-color: var(--st-gray-200);
  }

  /* 分页暗夜适配 */
  .page-btn {
    background: var(--st-bg-primary);
    border-color: var(--st-gray-200);
    color: var(--st-text-secondary);
  }

  .page-btn:hover:not(:disabled) {
    border-color: var(--st-primary-500);
  }

  /* 列表暗夜适配 */
  .list-item {
    border-bottom-color: var(--st-gray-200);
  }

  .list-item:hover {
    background: var(--st-bg-tertiary);
  }

  /* 空状态暗夜适配 */
  .empty-state-icon {
    color: var(--st-gray-400);
  }

  /* 开关暗夜适配 */
  .switch-slider {
    background: var(--st-gray-400);
  }

  .switch-slider::before {
    background: var(--st-bg-primary);
  }

  /* 导航链接暗夜适配 */
  .navbar-link:hover,
  .nav-link:hover {
    background: var(--st-primary-100);
  }

  .navbar-link.active,
  .nav-link.active {
    background: var(--st-primary-100);
  }
}

.navbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--st-container-xl);
  margin: 0 auto;
  padding: 0 var(--st-page-padding-x-lg);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
  font-family: var(--st-font-display);
  font-size: var(--st-text-xl);
  font-weight: var(--st-font-bold);
  color: var(--st-primary-600);
  text-decoration: none;
}

.navbar-brand:hover {
  text-decoration: none;
  color: var(--st-primary-700);
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
}

.navbar-link {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
  padding: var(--st-space-2) var(--st-space-4);
  font-size: var(--st-text-base);
  font-weight: var(--st-font-medium);
  color: var(--st-text-secondary);
  text-decoration: none;
  border-radius: var(--st-radius-lg);
  transition: all var(--st-duration-fast) var(--st-ease-default);
}

.navbar-link:hover {
  color: var(--st-primary-600);
  background: var(--st-primary-50);
  text-decoration: none;
}

.navbar-link.active {
  color: var(--st-primary-600);
  background: var(--st-primary-100);
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--st-space-2);
  font-size: var(--st-text-sm);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
  color: var(--st-text-secondary);
  text-decoration: none;
  transition: color var(--st-duration-fast);
}

.breadcrumb-item:hover {
  color: var(--st-primary-600);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--st-text-primary);
  font-weight: var(--st-font-medium);
}

.breadcrumb-separator {
  color: var(--st-gray-400);
}

/* 标签页 */
.tabs {
  display: flex;
  gap: var(--st-space-1);
  border-bottom: 2px solid var(--st-gray-200);
}

.tab {
  padding: var(--st-space-3) var(--st-space-4);
  font-size: var(--st-text-base);
  font-weight: var(--st-font-medium);
  color: var(--st-text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--st-duration-fast) var(--st-ease-default);
}

.tab:hover {
  color: var(--st-primary-600);
}

.tab.active {
  color: var(--st-primary-600);
  border-bottom-color: var(--st-primary-500);
}

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--st-space-2);
}

.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--st-space-3);
  font-size: var(--st-text-base);
  font-weight: var(--st-font-medium);
  color: var(--st-text-secondary);
  background: var(--st-bg-primary);
  border: 1px solid var(--st-gray-200);
  border-radius: var(--st-radius-md);
  cursor: pointer;
  transition: all var(--st-duration-fast) var(--st-ease-default);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--st-primary-500);
  color: var(--st-primary-600);
}

.page-btn.active {
  background: var(--st-primary-500);
  border-color: var(--st-primary-500);
  color: white;
}

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

/* ========================================
   8. 列表组件
   ======================================== */

.list {
  list-style: none;
}

.list-item {
  display: flex;
  align-items: center;
  padding: var(--st-space-4);
  border-bottom: 1px solid var(--st-gray-100);
  transition: background var(--st-duration-fast);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item:hover {
  background: var(--st-gray-50);
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-weight: var(--st-font-medium);
  color: var(--st-text-primary);
  margin-bottom: var(--st-space-1);
}

.list-item-desc {
  font-size: var(--st-text-sm);
  color: var(--st-text-tertiary);
}

.list-item-action {
  margin-left: var(--st-space-4);
}

/* ========================================
   9. 空状态组件
   ======================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--st-space-16) var(--st-space-6);
  text-align: center;
}

.empty-state-icon {
  font-size: 4rem;
  color: var(--st-gray-300);
  margin-bottom: var(--st-space-4);
}

.empty-state-title {
  font-size: var(--st-text-xl);
  font-weight: var(--st-font-semibold);
  color: var(--st-text-primary);
  margin-bottom: var(--st-space-2);
}

.empty-state-desc {
  font-size: var(--st-text-base);
  color: var(--st-text-secondary);
  margin-bottom: var(--st-space-6);
  max-width: 400px;
}

.empty-state-action {
  display: flex;
  gap: var(--st-space-3);
}

/* ========================================
   10. 骨架屏组件
   ======================================== */

.skeleton {
  background: var(--st-gray-100);
  border-radius: var(--st-radius-md);
  overflow: hidden;
}

.skeleton::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--st-space-2);
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: var(--st-space-3);
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--st-radius-full);
}

.skeleton-card {
  height: 200px;
  border-radius: var(--st-radius-xl);
}

/* ========================================
   11. 标准导航栏（页面通用，与 index.html 保持一致）
   ======================================== */

/* 导航栏滚动阴影 */
.navbar.scrolled {
  box-shadow: var(--st-shadow-md);
}

/* 导航品牌（Logo） */
.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
  font-family: var(--st-font-display);
  font-size: var(--st-text-2xl);
  font-weight: var(--st-font-bold);
  color: var(--st-primary-600);
  text-decoration: none;
  transition: color var(--st-duration-fast);
}

.nav-brand:hover {
  color: var(--st-primary-700);
  text-decoration: none;
}

.nav-brand i {
  font-size: 1.5rem;
}

/* 导航菜单 */
.nav-menu {
  display: flex;
  gap: var(--st-space-1);
  align-items: center;
}

/* 导航链接 */
.nav-link {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
  color: var(--st-text-secondary);
  text-decoration: none;
  padding: var(--st-space-2) var(--st-space-3);
  border-radius: var(--st-radius-lg);
  font-size: var(--st-text-sm);
  font-weight: var(--st-font-medium);
  transition: all var(--st-duration-fast) var(--st-ease-default);
}

.nav-link:hover {
  background: var(--st-primary-50);
  color: var(--st-primary-600);
  text-decoration: none;
}

.nav-link.active {
  background: var(--st-primary-100);
  color: var(--st-primary-700);
}

.nav-link.nav-link-primary {
  background: var(--st-gradient-brand);
  color: white;
  padding: var(--st-space-2) var(--st-space-4);
}

.nav-link.nav-link-primary:hover {
  background: var(--st-gradient-brand-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* 通知徽章 */
.nav-notification {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  background: var(--st-error-500);
  color: white;
  border-radius: var(--st-radius-full);
  padding: 1px 5px;
  font-size: 10px;
  font-weight: var(--st-font-bold);
  min-width: 16px;
  text-align: center;
  line-height: 1.4;
}

/* 导航用户名（登录后显示，超长截断） */
.nav-username {
  display: inline-block;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* 移动端汉堡按钮 */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: var(--st-text-xl);
  cursor: pointer;
  color: var(--st-text-secondary);
  padding: var(--st-space-2);
  border-radius: var(--st-radius-md);
  transition: all var(--st-duration-fast);
}

.mobile-menu-toggle:hover {
  background: var(--st-gray-100);
  color: var(--st-text-primary);
}

/* 跳过链接（无障碍） */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--st-primary-600);
  color: white;
  padding: var(--st-space-2) var(--st-space-4);
  border-radius: var(--st-radius-md);
  z-index: 9999;
  text-decoration: none;
  font-weight: var(--st-font-medium);
  transition: top var(--st-duration-fast);
}

.skip-link:focus {
  top: var(--st-space-2);
}


/* ========================================
   Auth 认证页面
   ======================================== */

/* 页面布局 */
.auth-container {
  display: flex;
  min-height: 100vh;
  background: var(--st-bg-secondary);
}

/* 表单区域 */
.auth-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--st-space-12) var(--st-space-10);
  max-width: 480px;
  background: var(--st-bg-primary);
}

.auth-header {
  margin-bottom: var(--st-space-8);
  text-align: center;
}

.auth-header .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--st-space-3);
  margin-bottom: var(--st-space-4);
}

.auth-header .logo i {
  font-size: 2rem;
  color: var(--st-primary-500);
}

.auth-header .logo h1 {
  font-size: var(--st-text-3xl);
  font-weight: var(--st-font-bold);
  color: var(--st-text-primary);
  margin: 0;
}

.auth-header .subtitle {
  color: var(--st-text-secondary);
  font-size: var(--st-text-base);
  margin: 0;
}

/* 表单 */
.auth-form {
  width: 100%;
}

.auth-form .form-group {
  margin-bottom: var(--st-space-5);
}

.auth-form .form-group label {
  display: block;
  margin-bottom: var(--st-space-2);
  font-size: var(--st-text-sm);
  font-weight: var(--st-font-medium);
  color: var(--st-text-primary);
}

.auth-form .input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-form .input-group > i:first-child {
  position: absolute;
  left: var(--st-space-4);
  color: var(--st-gray-400);
  pointer-events: none;
  z-index: 1;
}

.auth-form .input-group input {
  width: 100%;
  padding: var(--st-space-3) var(--st-space-4) var(--st-space-3) var(--st-space-10);
  font-size: var(--st-text-base);
  color: var(--st-text-primary);
  background: var(--st-bg-primary);
  border: 2px solid var(--st-gray-200);
  border-radius: var(--st-radius-lg);
  transition: all var(--st-duration-fast) var(--st-ease-default);
  outline: none;
  box-sizing: border-box;
}

.auth-form .input-group input:hover {
  border-color: var(--st-gray-300);
}

.auth-form .input-group input:focus {
  border-color: var(--st-primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-form .input-group input::placeholder {
  color: var(--st-gray-400);
}

/* 密码显示切换按钮 */
.toggle-password {
  position: absolute;
  right: var(--st-space-3);
  background: none;
  border: none;
  color: var(--st-gray-400);
  cursor: pointer;
  padding: var(--st-space-1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--st-duration-fast);
}

.toggle-password:hover {
  color: var(--st-primary-500);
}

/* 错误消息 */
.error-message {
  display: block;
  margin-top: var(--st-space-1);
  font-size: var(--st-text-sm);
  color: var(--st-error-500);
  min-height: 1.2em;
}

/* 表单选项行（记住我 + 忘记密码） */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--st-space-5);
}

/* 复选框容器 */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: var(--st-space-2);
  cursor: pointer;
  font-size: var(--st-text-sm);
  color: var(--st-text-secondary);
  user-select: none;
}

.checkbox-container input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--st-primary-500);
  cursor: pointer;
}

.forgot-password {
  font-size: var(--st-text-sm);
  color: var(--st-primary-500);
  text-decoration: none;
  transition: color var(--st-duration-fast);
}

.forgot-password:hover {
  color: var(--st-primary-700);
  text-decoration: underline;
}

/* 提交按钮 */
.auth-button {
  width: 100%;
  padding: var(--st-space-4);
  background: var(--st-gradient-brand);
  color: white;
  border: none;
  border-radius: var(--st-radius-lg);
  font-size: var(--st-text-base);
  font-weight: var(--st-font-semibold);
  cursor: pointer;
  transition: all var(--st-duration-normal) var(--st-ease-bounce);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--st-space-2);
}

.auth-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.auth-button:active:not(:disabled) {
  transform: translateY(0);
}

.auth-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* 页脚链接 */
.auth-footer {
  text-align: center;
  margin-top: var(--st-space-6);
}

.auth-footer p {
  font-size: var(--st-text-sm);
  color: var(--st-text-secondary);
  margin: 0;
}

.auth-footer a {
  color: var(--st-primary-500);
  font-weight: var(--st-font-medium);
  text-decoration: none;
  transition: color var(--st-duration-fast);
}

.auth-footer a:hover {
  color: var(--st-primary-700);
  text-decoration: underline;
}

/* 右侧装饰区域 */
.auth-image {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--st-gradient-bg);
  padding: var(--st-space-12);
  position: relative;
  overflow: hidden;
}

.auth-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.image-content {
  position: relative;
  text-align: center;
  color: white;
}

.image-content i {
  font-size: 5rem;
  margin-bottom: var(--st-space-6);
  opacity: 0.9;
  display: block;
}

.image-content h2 {
  font-size: var(--st-text-4xl);
  font-weight: var(--st-font-bold);
  margin-bottom: var(--st-space-4);
  line-height: 1.2;
}

.image-content p {
  font-size: var(--st-text-lg);
  opacity: 0.85;
  line-height: var(--st-leading-relaxed);
  max-width: 400px;
  margin: 0 auto;
}

/* 全局错误/成功消息横幅 */
.auth-message {
  padding: var(--st-space-3) var(--st-space-4);
  border-radius: var(--st-radius-lg);
  font-size: var(--st-text-sm);
  margin-bottom: var(--st-space-5);
  display: none;
}

.auth-message.show { display: block; }

.auth-message.success {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.auth-message.error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* 响应式 */
@media (max-width: 768px) {
  .auth-image {
    display: none;
  }

  .auth-card {
    max-width: 100%;
    padding: var(--st-space-8) var(--st-space-6);
  }
}

/* 移动端/平板响应式 - 导航栏折叠 */
@media (max-width: 1023px) {
  .navbar-content {
    padding: 0 var(--st-page-padding-x);
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--st-bg-primary);
    flex-direction: column;
    padding: var(--st-space-4);
    gap: var(--st-space-1);
    box-shadow: var(--st-shadow-lg);
    border-top: 1px solid var(--st-gray-100);
    z-index: 999;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: var(--st-space-3) var(--st-space-4);
    font-size: var(--st-text-base);
  }
}

/* ========================================
   AI 流式输出组件
   ======================================== */

/* 流式输出卡片（write 页面续写/润色） */
.ai-streaming-card {
  background: var(--st-surface-secondary, #f8f9fa);
  border: 1px solid var(--st-border-color, #e2e8f0);
  border-radius: var(--st-radius-lg, 12px);
  padding: var(--st-space-4, 16px);
  margin-top: var(--st-space-3, 12px);
  position: relative;
}

@media (prefers-color-scheme: dark) {
  .ai-streaming-card {
    background: var(--st-surface-secondary, #1e293b);
    border-color: var(--st-border-color, #334155);
  }
}

.ai-streaming-card .ai-stream-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--st-text-secondary, #64748b);
}

.ai-streaming-card .ai-stream-content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--st-text-primary, #1e293b);
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (prefers-color-scheme: dark) {
  .ai-streaming-card .ai-stream-content {
    color: var(--st-text-primary, #e2e8f0);
  }
}

.ai-streaming-card .ai-stream-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--st-border-color, #e2e8f0);
}

@media (prefers-color-scheme: dark) {
  .ai-streaming-card .ai-stream-actions {
    border-top-color: var(--st-border-color, #334155);
  }
}

/* 流式指示器（脉冲动画） */
.ai-streaming-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--st-primary, #6366f1);
  animation: ai-pulse 1.2s ease-in-out infinite;
}

@keyframes ai-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* create-ai 流式加载预览 */
.ai-stream-loading {
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.ai-stream-loading .ai-stream-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--st-text-secondary, #64748b);
}

.ai-stream-loading .ai-stream-preview {
  background: var(--st-surface-primary, #fff);
  border: 1px solid var(--st-border-color, #e2e8f0);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--st-text-secondary, #64748b);
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

@media (prefers-color-scheme: dark) {
  .ai-stream-loading .ai-stream-preview {
    background: var(--st-surface-secondary, #1e293b);
    border-color: var(--st-border-color, #334155);
    color: var(--st-text-secondary, #94a3b8);
  }
}

/* 多步骤流式进度 */
.ai-multistep-loading {
  padding: 20px;
}

.ai-steps-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.step-dot.step-pending {
  background: var(--st-gray-200, #e2e8f0);
  color: var(--st-gray-500, #64748b);
}

.step-dot.step-active {
  background: var(--st-primary, #6366f1);
  color: #fff;
  animation: stepPulse 1.5s ease-in-out infinite;
}

.step-dot.step-done {
  background: var(--st-success, #10b981);
  color: #fff;
}

@keyframes stepPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
}

.ai-multistep-loading .ai-stream-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--st-text-secondary, #64748b);
}

.ai-multistep-loading .ai-stream-preview {
  background: var(--st-surface-secondary, #f8fafc);
  border: 1px solid var(--st-border-color, #e2e8f0);
  border-radius: 8px;
  padding: 12px 16px;
  max-height: 200px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--st-text-secondary, #64748b);
}

@media (prefers-color-scheme: dark) {
  .step-dot.step-pending {
    background: var(--st-gray-700, #334155);
    color: var(--st-gray-400, #94a3b8);
  }
}

@media (prefers-color-scheme: dark) {
  .ai-multistep-loading .ai-stream-preview {
    background: var(--st-surface-secondary, #1e293b);
    border-color: var(--st-border-color, #334155);
    color: var(--st-text-secondary, #94a3b8);
  }
}

/* Loading tip */
.ai-loading-tip {
  font-size: 0.8rem;
  color: var(--st-text-tertiary, #94a3b8);
  text-align: center;
  margin: 0.5rem 0;
  font-style: italic;
  transition: opacity 0.3s;
}

/* Step result cards */
.ai-step-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.step-result-card {
  background: var(--st-surface-secondary, #f1f5f9);
  border: 1px solid var(--st-border-color, #e2e8f0);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  animation: cardSlideIn 0.3s ease-out;
}

.step-result-card strong {
  color: var(--st-text-primary, #1e293b);
}

.step-card-text {
  margin: 0.25rem 0 0;
  color: var(--st-text-secondary, #64748b);
  line-height: 1.4;
}

.step-card-badge {
  display: inline-block;
  background: var(--st-primary, #6366f1);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-right: 0.4rem;
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-color-scheme: dark) {
  .step-result-card {
    background: var(--st-surface-secondary, #1e293b);
    border-color: var(--st-border-color, #334155);
  }
}

@media (prefers-color-scheme: dark) {
  .step-result-card strong {
    color: var(--st-text-primary, #e2e8f0);
  }
}

/* ========================================
   AI 骨架屏进度展示
   ======================================== */

.ai-skeleton-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.ai-skeleton-list {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.ai-skeleton-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.ai-skeleton-label {
  flex: 1 1 0;
  min-width: 0;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  color: var(--st-text-secondary, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-skeleton-bar {
  flex: 1 1 auto;
  min-width: 40px;
  height: 20px;
  border-radius: var(--st-radius-md, 6px);
}

.ai-skeleton-bar.done {
  background: transparent;
  border: none;
  animation: none;
}

.ai-skeleton-bar.done::after {
  display: none;
}

.ai-skeleton-check {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
}

/* ========================================
   AI 思考过程面板
   ======================================== */

.ai-thinking-panel {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 16px;
  height: 200px;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  contain: strict;
  background: var(--st-surface-secondary, #f8fafc);
  border-radius: 8px;
  padding: 12px 16px;
  border: 1px solid var(--st-border-color, #e2e8f0);
}

.ai-thinking-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--st-text-secondary, #64748b);
  margin-bottom: 8px;
}

.ai-thinking-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--st-primary, #6366f1);
  border-top-color: transparent;
  border-radius: 50%;
  animation: ai-thinking-spin 1s linear infinite;
}

@keyframes ai-thinking-spin {
  to { transform: rotate(360deg); }
}

.ai-thinking-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--st-text-secondary, #64748b);
  word-break: break-word;
  white-space: pre-wrap;
}

@media (prefers-color-scheme: dark) {
  .ai-thinking-panel {
    background: #141426;
    border-color: var(--st-border-color, #334155);
  }
}

@media (prefers-color-scheme: dark) {
  .ai-thinking-text {
    color: #d0d0e0;
  }
}

/* 移动端 thinking 面板 */
@media (max-width: 479px) {
  .ai-thinking-panel {
    height: 150px;
    padding: 10px 12px;
  }
  .ai-thinking-text {
    font-size: 12px;
  }
}

/* 无障碍：减少动画 */
@media (prefers-reduced-motion: reduce) {
  .ai-thinking-icon {
    animation: none;
  }
}

