/* 生词本 V2 卡片式样式 —— 2026-08-14 重构 */

/* 类型筛选栏（新增） */
#vocab-kind-filters {
  display: flex;
  gap: 8px;
  padding: 12px 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#vocab-kind-filters::-webkit-scrollbar { display: none; }
.vocab-kind-filter {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
  -webkit-tap-highlight-color: var(--accent-wash);
}
.vocab-kind-filter.is-active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* 卡片网格 */
.vc-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  padding-bottom: 24px;
}

@media (min-width: 640px) {
  .vc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 单张卡片 */
.vc-card {
  background: var(--card-bg);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

/* 类型左侧装饰条 */
.vc-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--ink-stone);
  opacity: 0.3;
}

.vc-card--word::before { background: #3b82f6; }
.vc-card--phrase::before { background: #10b981; }
.vc-card--sentence::before { background: #f59e0b; }

@media (hover: hover) {
  .vc-card:hover {
    border-color: var(--ink-soft);
    box-shadow: 0 4px 12px rgba(42, 38, 30, 0.08);
    transform: translateY(-2px);
  }
}

/* 卡片头部（已移除，类型选择器移到底部） */

/* 主内容区：单词本身大而突出 */
.vc-main {
  min-height: 64px;
  padding: 8px 0 12px;
}

.vc-text {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  word-wrap: break-word;
  letter-spacing: -0.01em;
}

.vc-card--sentence .vc-text {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: 0;
}

.vc-card--phrase .vc-text {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

/* 语境 */
.vc-context {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  padding: 10px;
  background: rgba(155, 145, 124, 0.08);
  border-radius: 8px;
  border-left: 3px solid var(--line);
}

/* 元信息行：左侧信息 + 右侧类型选择器 */
.vc-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

/* 元信息（左侧） */
.vc-meta {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-stone);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  line-height: 1.5;
  flex: 1;
  min-width: 0; /* 允许收缩 */
}

.vc-source {
  font-weight: 500;
  color: var(--ink-soft);
}

/* 类型选择器（右侧，与元信息同行） */
.vc-kind-select {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-stone);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px 3px 4px;
  cursor: pointer;
  transition: all 0.15s;
  flex: none; /* 不收缩 */
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239B917C' d='M6 8L3 5h6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 20px;
}

.vc-kind-select:hover {
  border-color: var(--ink-soft);
  background-color: var(--tag-bg);
}

.vc-kind-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-wash);
}

/* 搜索高亮 */
.vc-card mark {
  background: rgba(201, 162, 39, 0.35);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 600;
}

/* 操作栏 */
.vc-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.vc-btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  background: var(--tag-bg);
  color: var(--ink-soft);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
  -webkit-tap-highlight-color: var(--accent-wash);
}

.vc-btn:active {
  transform: scale(0.96);
}

.vc-btn--primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.vc-btn--primary:active {
  background: #8b2b23;
}

.vc-btn--danger {
  background: transparent;
  color: var(--ink-stone);
  flex: 0;
  padding: 8px 12px;
  font-size: 16px;
}

@media (hover: hover) {
  .vc-btn:hover {
    background: var(--accent-wash);
    color: var(--accent);
  }
  .vc-btn--primary:hover {
    background: #8b2b23;
    color: var(--bg);
  }
  .vc-btn--danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
  }
}

/* 紧凑视图（备用） */
.vc-grid--compact .vc-card {
  padding: 12px;
  gap: 8px;
}

.vc-grid--compact .vc-text {
  font-size: 16px;
}

.vc-grid--compact .vc-context {
  font-size: 13px;
  padding: 8px;
}

/* 响应式调整 */
@media (max-width: 400px) {
  .vc-card {
    padding: 14px;
  }

  .vc-text {
    font-size: 17px;
  }

  .vc-btn {
    font-size: 12px;
    padding: 7px 12px;
  }
}

/* 工具栏分隔线 */
#vocab-toolbar {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

/* 加载动画 */
.vc-grid--loading {
  opacity: 0.5;
  pointer-events: none;
}

/* 过渡动画 */
.vc-card {
  animation: vcFadeIn 0.3s ease-out;
}

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

/* 错位动画（逐张入场） */
.vc-grid .vc-card:nth-child(1) { animation-delay: 0s; }
.vc-grid .vc-card:nth-child(2) { animation-delay: 0.05s; }
.vc-grid .vc-card:nth-child(3) { animation-delay: 0.1s; }
.vc-grid .vc-card:nth-child(4) { animation-delay: 0.15s; }
.vc-grid .vc-card:nth-child(5) { animation-delay: 0.2s; }
.vc-grid .vc-card:nth-child(6) { animation-delay: 0.25s; }
