{% extends "base.html" %}
{% block extra_head %}
<style>
/* Immersive Media Feed Layout */
body {
  padding-bottom: 0 !important;
  overscroll-behavior-y: none;
  background-color: #000;
}
html, body {
  height: 100%;
  overflow: hidden;
}

#container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #000;
}

#feed-container {
  position: absolute;
  inset: 0;
}

.feed-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.feed-media.active {
  display: block;
}
.feed-theme-strip {
  display: none;
  width: min(100%, 980px);
  height: auto;
  max-height: calc(100% - 112px - env(safe-area-inset-bottom));
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(244, 114, 182, 0.22), transparent 32%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.2), transparent 26%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  z-index: 12;
  pointer-events: auto;
}
.feed-theme-strip.active {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feed-image-group {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  transform: none;
  z-index: 9;
  pointer-events: none;
}
.feed-image-group.active {
  display: block;
}
.image-group-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.image-group-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.18s ease, transform 0.22s ease;
}
.image-group-overlay {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  left: auto;
  bottom: auto;
  padding: 0;
  background: transparent;
}
.image-group-counter {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.theme-strip-header {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 2px;
}
.theme-strip-header h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.1;
  color: #fff;
  font-weight: 800;
}
.theme-strip-group-shell {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(2, 6, 23, 0.96);
}
.theme-strip-group-shell.is-active {
  display: flex;
}
.theme-strip-group-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}
.theme-strip-group-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: rgba(2, 6, 23, 0.96);
}
.theme-strip-group-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}
.theme-strip-group-counter {
  font-size: 12px;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.86);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.theme-strip-group-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.theme-strip-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}
.theme-strip-nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.theme-strip-group-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px 16px;
}
.theme-strip-group-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  word-break: break-word;
}
.theme-strip-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  align-content: start;
  overflow: auto;
}
.theme-strip-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  scroll-snap-align: start;
}
.theme-strip-card.is-selected .theme-strip-thumb {
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24);
}
.theme-strip-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 4 / 5;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.theme-strip-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.theme-strip-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 1px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.theme-strip-card:hover::after,
.theme-strip-card:focus-visible::after {
  border-color: rgba(255, 255, 255, 0.35);
}
@media (max-width: 700px) {
  .feed-theme-strip {
    width: calc(100% - 20px);
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
    border-radius: 24px;
    max-height: calc(100% - 84px - env(safe-area-inset-bottom));
  }
  .theme-strip-group-bar,
  .theme-strip-group-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .theme-strip-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 960px) {
  .theme-strip-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
}

#play-status-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 80px;
  height: 80px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  pointer-events: none;
  z-index: 15;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}
#play-status-icon.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

#custom-controls {
  position: absolute;
  bottom: calc(90px + env(safe-area-inset-bottom));
  left: 12px;
  right: 12px;
  height: 20px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-container {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
}

input[type=range] {
  -webkit-appearance: none;
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 2;
  cursor: pointer;
  margin: 0;
}
input[type=range]:disabled {
  cursor: default;
}

.progress-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  transition: all 0.2s ease;
  pointer-events: none;
}

.progress-fill {
  position: absolute;
  left: 0;
  height: 4px;
  background: #fff;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear, height 0.2s ease;
  pointer-events: none;
  z-index: 1;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.time-display {
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-family: system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  width: 35px;
  text-align: center;
  opacity: 1;
  transition: opacity 0.2s;
}

body.immersive-mode #custom-controls {
  bottom: calc(0px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  padding: 0;
  gap: 0;
}

body.immersive-mode .progress-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 0;
}

body.immersive-mode .progress-fill {
  height: 2px;
  border-radius: 0;
}

body.immersive-mode .time-display {
  opacity: 0;
  width: 0;
  overflow: hidden;
  margin: 0;
}

body:not(.immersive-mode) .progress-fill::after {
  transform: translateY(-50%) scale(1);
}

body.immersive-mode .controls-sidebar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
}
body.immersive-mode .floating-dock {
  transform: translate(-50%, 150%) !important;
}
body.immersive-mode #quick-theme-toggle {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
}

.controls-sidebar {
  position: absolute;
  right: 16px;
  bottom: calc(140px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 20;
  align-items: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.action-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s;
  cursor: pointer;
  position: relative;
}
.action-btn:active {
  transform: scale(0.9);
}
.action-btn svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.speed-btn {
  font-size: 14px;
  font-weight: 700;
  font-family: system-ui, -apple-system, sans-serif;
}

@keyframes heart-burst {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.action-btn.is-active .heart-filled {
  display: block;
  color: #fe2c55;
  animation: heart-burst 0.3s forwards;
}
.action-btn.is-active .heart-outline {
  display: none;
}
.heart-filled {
  display: none;
}
.action-btn .collection-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.action-btn.has-collection {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.72);
}
.action-btn.has-collection .collection-count {
  display: inline-flex;
}

/* Image overlay controls */
.image-tool-wrap {
  position: relative;
}
.zoom-options {
  position: absolute;
  right: 58px;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transition: all 0.2s ease;
}
.zoom-options.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.zoom-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.2s ease;
}
.zoom-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-color: white;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.magnifier {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  background-repeat: no-repeat;
  background-color: #000;
  cursor: grab;
  z-index: 210;
  display: none;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), width 0.3s ease, height 0.3s ease;
}
.magnifier.magnifier-large {
  width: 300px;
  height: 300px;
}
.magnifier.active {
  display: block;
  transform: translate(-50%, -50%) scale(1);
}
.magnifier:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.02);
}
.mag-badge {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.magnifier.active .mag-badge {
  opacity: 1;
}

.caption-panel {
  position: fixed;
  left: 20px;
  bottom: 90px;
  max-width: min(72vw, 420px);
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: white;
  backdrop-filter: blur(10px);
  z-index: 215;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.caption-title {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
}
.caption-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.caption-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.86);
}
.caption-panel.is-hidden {
  display: none;
}
body.immersive-mode .caption-panel:not(.is-hidden) {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

#caption-btn.is-loading::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-top-color: transparent;
  animation: caption-spin 0.9s linear infinite;
}
#caption-btn {
  position: relative;
}
#caption-btn.is-loading i {
  opacity: 0.35;
}
#caption-btn.is-error::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  border: 1.5px solid rgba(248, 113, 113, 0.9);
}
@keyframes caption-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .caption-panel {
    max-width: min(82vw, 320px);
    left: 12px;
  }
}

.collection-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(15, 23, 42, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.collection-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.collection-modal-card {
  width: min(440px, 100%);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.3);
  padding: 12px;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.collection-modal.active .collection-modal-card {
  transform: translateY(0);
}
[data-theme="dark"] .collection-modal-card {
  background: rgba(15, 23, 42, 0.98);
  border-color: rgba(148, 163, 184, 0.2);
  color: #f8fafc;
}
.collection-modal-header {
  margin-bottom: 10px;
}
.collection-modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.collection-modal-header h3 {
  font-size: 14px;
  font-weight: 700;
}
.collection-modal-meta {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}
[data-theme="dark"] .collection-modal-meta {
  color: #94a3b8;
}
.collection-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.collection-modal-close svg {
  width: 15px;
  height: 15px;
}
.collection-modal-create {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.collection-modal-create input {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(248, 250, 252, 0.86);
  color: #0f172a;
  font-size: 13px;
  padding: 8px 10px;
}
[data-theme="dark"] .collection-modal-create input {
  background: rgba(15, 23, 42, 0.82);
  color: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.2);
}
.collection-modal-create button {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
}
[data-theme="dark"] .collection-modal-create button {
  background: rgba(226, 232, 240, 0.94);
  color: #0f172a;
}
.collection-modal-list {
  max-height: min(44vh, 320px);
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(248, 250, 252, 0.78);
}
[data-theme="dark"] .collection-modal-list {
  background: rgba(15, 23, 42, 0.76);
  border-color: rgba(148, 163, 184, 0.2);
}
.collection-modal-item {
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.collection-modal-item:hover {
  background: rgba(148, 163, 184, 0.12);
}
.collection-modal-item.is-pending {
  opacity: 0.6;
  pointer-events: none;
}
.collection-modal-item.is-selected {
  background: rgba(99, 102, 241, 0.07);
}
.collection-modal-item input[type="checkbox"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.collection-modal-item span.coll-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
em.coll-count {
  font-style: normal;
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
}
.coll-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #64748b;
}
.coll-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(148, 163, 184, 0.45);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.coll-check svg { display: none; color: white; }
.collection-modal-item.is-selected .coll-check {
  background: #6366f1;
  border-color: #6366f1;
}
.collection-modal-item.is-selected .coll-check svg { display: block; }
.collection-modal-empty {
  text-align: center;
  font-size: 12px;
  color: #64748b;
  padding: 14px 8px;
}
[data-theme="dark"] .collection-modal-empty {
  color: #94a3b8;
}
.coll-drag-handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.35);
  margin: 12px auto 16px;
  display: none;
}
@media (max-width: 540px) {
  .collection-modal {
    align-items: flex-end;
    padding: 0;
  }
  .collection-modal-card {
    width: 100%;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    padding: 0 12px 24px;
  }
  .collection-modal.active .collection-modal-card {
    transform: translateY(0);
  }
  .coll-drag-handle { display: block; }
}
</style>
{% endblock %}

{% block content %}
<div id="container">
  <div id="feed-container"></div>

  <div id="overlay-layer"></div>

  <div id="play-status-icon">
    <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24" fill="currentColor" stroke="none">
      <polygon points="5 3 19 12 5 21 5 3"></polygon>
    </svg>
  </div>

  <div id="custom-controls">
    <span class="time-display" id="time-current">00:00</span>
    <div class="progress-container">
      <input type="range" id="video-progress" min="0" max="100" step="0.1" value="0">
      <div class="progress-track"></div>
      <div class="progress-fill" id="progress-fill"></div>
    </div>
    <span class="time-display" id="time-total">00:00</span>
  </div>

  <div class="controls-sidebar" id="controls">
    <div class="action-btn speed-btn" id="speed-btn">1x</div>

    <button type="button" class="action-btn" id="caption-btn" title="生成标题" hidden>
      <i data-feather="zap"></i>
    </button>

    <div class="image-tool-wrap" id="magnifier-tool-wrap" hidden>
      <div class="zoom-options" id="zoom-options">
        <button type="button" class="zoom-btn active" data-level="2.5">2.5x</button>
        <button type="button" class="zoom-btn" data-level="5">5x</button>
      </div>
      <button type="button" class="action-btn" id="magnifier-toggle" title="放大镜">
        <i data-feather="search"></i>
      </button>
    </div>

    <a href="#" class="action-btn" id="favorite-btn" data-value="">
      <svg class="heart-outline" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>
      <svg class="heart-filled" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>
    </a>

    <button type="button" class="action-btn" id="collection-btn" title="加入集合">
      <i data-feather="bookmark"></i>
      <span class="collection-count" id="collection-count">0</span>
    </button>

    <a href="#" class="action-btn" id="info-btn">
      <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>
    </a>
  </div>

  <div class="caption-panel is-hidden" id="caption-panel">
    <div class="caption-title hidden" id="caption-title"></div>
    <div class="caption-tags" id="caption-tags"></div>
  </div>

  <div class="magnifier" id="magnifier">
    <div class="mag-badge" id="mag-badge">2.5x</div>
  </div>
</div>

<div id="collection-modal" class="collection-modal" aria-hidden="true">
  <div class="collection-modal-card">
    <div class="coll-drag-handle"></div>
    <div class="collection-modal-header">
      <div class="collection-modal-title-row">
        <h3>加入集合</h3>
        <button id="collection-modal-close" type="button" class="collection-modal-close">
          <i data-feather="x"></i>
        </button>
      </div>
      <div id="collection-modal-meta" class="collection-modal-meta">当前未加入任何集合</div>
    </div>
    <div id="collection-list" class="collection-modal-list"></div>
    <div class="collection-modal-create">
      <input id="collection-name-input" type="text" maxlength="80" placeholder="新建集合名称" />
      <button id="collection-create-btn" type="button">新建</button>
    </div>
  </div>
</div>
{% endblock %}

{% block extra_body %}
<script src="{{url_for('static', filename='flow_ui_shared.js')}}"></script>
<script src="{{url_for('static', filename='flow_state_controller.js')}}"></script>
<script src="{{url_for('static', filename='flow_session.js')}}"></script>
<script src="{{url_for('static', filename='flow_actions_shared.js')}}"></script>
<script src="{{url_for('static', filename='flow_media_actions_controller.js')}}"></script>
<script src="{{url_for('static', filename='hammer.min.js')}}"></script>
<script src="{{url_for('static', filename='home_feed_controller.js')}}"></script>
{% endblock %}
