.history {
  background: #f5f6f8;
  min-height: 100vh;
  padding-bottom: 60px;
  display: flex;
  flex-direction: column;
}

.history-header {
  padding: 32px 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
}

.history-title {
  font-size: 32px;
  font-weight: 600;
  color: #1d1f22;
}

.language-switcher-compact {
  flex-shrink: 0;
}

.history-list {
  padding: 0;
  position: relative;
  z-index: 2;
}

.history-grid {
  margin: 0 auto;
  padding: 8px 16px;
  min-height: 100%;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.loading-text {
  font-size: 18px;
  color: #666;
  font-weight: 500;
  margin: 0 auto;
}

.empty-state {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 80px auto;
  padding: 40px 20px;
}

.empty-icon {
  font-size: 56px;
  display: block;
  margin-bottom: 32px;
  opacity: 0.8;
}

.empty-icon-image {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto;
  opacity: 0.6;
}

.empty-text {
  font-size: 16px;
  color: #b9b9b9;
  display: block;
  margin-top: 16px;
}

.login-required-state {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 80px auto;
  padding: 40px 20px;
}

.login-icon-image {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto 24px auto;
  opacity: 0.6;
}

.login-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.login-title {
  font-size: 24px;
  font-weight: 600;
  color: #1d1f22;
  margin: 0;
}

.login-description {
  font-size: 16px;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

.login-button {
  color: #fff;
  background: #000;
  border: none;
  border-radius: 24px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
  letter-spacing: 0.5px;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgb(0 0 0 / 10%);
}

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgb(0 0 0 / 10%);
}

.history-item {
  border-radius: 12px;
  padding: 8px 20px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: #1d1f22;
}

.item-thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  margin-right: 20px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.thumbnail-image {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: #f5f5f5;
  object-fit: cover;
}

.thumbnail-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, #007aff, #5ac8fa);
}

/* 生成中状态 */
.thumbnail-placeholder.generating {
  background: linear-gradient(135deg, #ff9500, #ffb84d);
}

/* 失败状态 */
.thumbnail-placeholder.failed {
  background: linear-gradient(135deg, #ff3b30, #ff6b6b);
}

.thumbnail-icon {
  font-size: 40px;
  filter: drop-shadow(0 2px 4px rgb(0 0 0 / 20%));
}

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

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.item-title {
  font-size: 18px;
  font-weight: 600;
  color: #1d1f22;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
  margin-right: 16px;
}

.item-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.item-status {
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 24px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.item-status::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentcolor;
}

/* 生成中状态 */
.item-status[style*='color: rgb(255, 149, 0)'],
.item-status[style*='color: #FF9500'] {
  background: linear-gradient(135deg, #ff9500 0%, #ffb84d 100%);
  color: #fff !important;
  box-shadow: 0 2px 8px rgb(255 149 0 / 30%);
}

.item-status[style*='color: rgb(255, 149, 0)']::before,
.item-status[style*='color: #FF9500']::before {
  background: #fff;
}

/* 已完成状态 */
.item-status[style*='color: rgb(52, 199, 89)'],
.item-status[style*='color: #34C759'] {
  background: linear-gradient(135deg, #34c759 0%, #4cd964 100%);
  color: #fff !important;
  box-shadow: 0 2px 8px rgb(52 199 89 / 30%);
}

.item-status[style*='color: rgb(52, 199, 89)']::before,
.item-status[style*='color: #34C759']::before {
  background: #fff;
}

/* 失败状态 */
.item-status[style*='color: rgb(255, 59, 48)'],
.item-status[style*='color: #FF3B30'] {
  background: linear-gradient(135deg, #ff3b30 0%, #ff6b6b 100%);
  color: #fff !important;
  box-shadow: 0 2px 8px rgb(255 59 48 / 30%);
}

.item-status[style*='color: rgb(255, 59, 48)']::before,
.item-status[style*='color: #FF3B30']::before {
  background: #fff;
}

.item-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.item-type {
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, #007aff 0%, #5ac8fa 100%);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgb(0 122 255 / 20%);
  letter-spacing: 0.5px;
}

.item-time {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.7;
}

/* 加载指示器 */
.loading-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff9500;
  font-size: 0;
}

/* 操作提示 */
.action-hint {
  display: flex;
  align-items: center;
}

.hint-text {
  font-size: 14px;
  color: #007aff;
  background: rgb(0 122 255 / 10%);
  padding: 4px 12px;
  border-radius: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* 缩略图毛玻璃蒙版 */
.thumbnail-overlay {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  z-index: 10;
  pointer-events: none;
}

/* 缩略图进度遮罩层 */
.thumbnail-progress-overlay {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgb(0 0 0 / 20%) 0%, rgb(0 0 0 / 10%) 50%, rgb(0 0 0 / 30%) 100%);
  z-index: 4;
  pointer-events: none;
}

/* 缩略图光扫描动画 */
.thumbnail-scan-light {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgb(255 255 255 / 8%) 40%,
    rgb(255 255 255 / 15%) 50%,
    rgb(255 255 255 / 8%) 60%,
    transparent 100%
  );
  z-index: 5;
  animation: thumbnail-scan 2s ease-in-out infinite;
  pointer-events: none;
}

/* 缩略图加载转圈 */
.thumbnail-loader {
  position: absolute;
  top: calc(50%); /* 向上移动25px */
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border: 3px solid transparent;
  border-top: 3px solid #fff;
  border-radius: 50%;
  z-index: 6;
  animation: spin 1s linear infinite;
  pointer-events: none;
}

/* 缩略图进度文字 */
.thumbnail-scan-progress {
  font-size: 24px;
  color: #fff;
  font-weight: 700;
  z-index: 7;
  text-shadow: 0 2px 4px rgb(0 0 0 / 50%), 0 0 8px rgb(0 0 0 / 30%), 0 0 16px rgb(0 0 0 / 20%);
  position: absolute;
  top: calc(50% + 25px); /* 向下移动25px */
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* 动画效果 */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }

  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* 缩略图扫描动画 */
@keyframes thumbnail-scan {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* 转圈动画 */
@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
