/* 观看记录页：区块标题 + 清空 + 行内移除（对照 v2-assets/我的收藏有数据列表） */

.ys2-user-history-toolbar-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: space-between;
  margin: 0 0 17px;
}

.ys2-user-history-heading {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  min-width: 0;
}

.ys2-user-history-heading h2 {
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -.6px;
  margin: 0;
}

.ys2-user-history-meta {
  color: var(--ys2-muted);
  font-size: 14px;
}

.ys2-user-history-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ys2-user-history-kinds {
  background: color-mix(in srgb, var(--ys2-text) 6%, var(--ys2-surface));
  border: 1px solid var(--ys2-line);
  border-radius: 9px;
  display: flex;
  overflow: hidden;
}

.ys2-user-history-kinds button {
  background: transparent;
  border: 0;
  color: var(--ys2-muted);
  cursor: pointer;
  font-size: 15px;
  min-width: 120px;
  padding: 11px 24px;
}

.ys2-user-history-kinds button.is-active {
  background: color-mix(in srgb, var(--ys2-accent) 34%, var(--ys2-surface));
  color: var(--ys2-text);
  font-weight: 750;
}

.ys2-user-history-search {
  display: inline-flex;
  align-items: center;
  position: relative;
}
.ys2-user-history-search input {
  background: var(--ys2-surface);
  border: 1px solid var(--ys2-line);
  border-radius: 7px;
  color: var(--ys2-text);
  font: inherit;
  min-height: 38px;
  padding: 7px 40px 7px 12px;
  width: 220px;
}
.ys2-user-history-search input:focus { border-color: var(--ys2-accent); outline: none; }
.ys2-user-history-search-btn {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ys2-muted);
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
}
.ys2-user-history-search-btn svg { height: 22px; width: 22px; }
.ys2-user-history-search-btn:hover { color: var(--ys2-accent); }

/* TASK-V2-PC-HISTORY-SEARCH-BTN-BORDER：覆盖 actions button 通用框线；取消上右下边框，左边线直角 */
.ys2-user-history-actions .ys2-user-history-search-btn {
  background: transparent;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid var(--ys2-line);
  border-radius: 0;
  color: var(--ys2-muted);
  min-height: 0;
  padding: 0;
}

.ys2-user-history-actions .ys2-user-history-search-btn:hover {
  background: transparent;
  border-top-color: transparent;
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-left-color: var(--ys2-line);
  color: var(--ys2-accent);
}

.ys2-user-history-timeline { display: grid; gap: 28px; }
.ys2-user-history-group { display: grid; gap: 12px; padding-left: 88px; position: relative; }
.ys2-user-history-group::before { background: var(--ys2-line); bottom: -28px; content: ''; left: 39px; position: absolute; top: 34px; width: 2px; }
.ys2-user-history-group:last-child::before { bottom: 50%; }
.ys2-user-history-group > h2 {
  background: var(--ys2-accent);
  border-radius: 7px;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  left: 0;
  margin: 0;
  padding: 9px 12px;
  position: absolute;
  text-align: center;
  top: 0;
  width: 66px;
}

html.ys-dark .ys2-user-history-group > h2 { color: #111; }

.ys2-user-history-actions button {
  background: var(--ys2-surface);
  border: 1px solid var(--ys2-line);
  border-radius: 7px;
  color: var(--ys2-text);
  cursor: pointer;
  font-size: 13px;
  min-height: 36px;
  padding: 6px 12px;
}

.ys2-user-history-actions button:hover {
  border-color: var(--ys2-accent);
  color: var(--ys2-accent);
}

.ys2-user-history-actions button:disabled { cursor: not-allowed; opacity: .5; }

.ys2-user-history-item-actions {
  display: contents;
}

.ys2-user-history-item-actions button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--ys2-line);
  border-radius: 9px;
  color: var(--ys2-muted);
  cursor: pointer;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  min-width: 42px;
  padding: 0;
  transition: border-color .15s ease, color .15s ease;
}

.ys2-user-history-item-actions button:hover {
  border-color: var(--ys2-accent);
  color: var(--ys2-accent);
}

.ys2-user-history-item-actions button svg {
  height: 21px;
  width: 21px;
}

.ys2-user-history-error {
  color: var(--ys2-muted);
  margin: 12px 0 24px;
}

@media (max-width: 620px) {
  .ys2-user-history-heading h2 {
    font-size: 21px;
  }

  .ys2-user-history-kinds { width: 100%; }
  .ys2-user-history-kinds button { flex: 1; min-width: 0; }
  .ys2-user-history-actions,
  .ys2-user-history-search,
  .ys2-user-history-search input { width: 100%; }
  .ys2-user-history-group { padding-left: 0; padding-top: 45px; }
  .ys2-user-history-group::before { display: none; }
}
