* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
  background: linear-gradient(145deg, #f8fafc 0%, #eef2f9 100%);
  min-height: 100vh;
  padding: 2rem 1.5rem;
  color: #0f172a;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

.container {
  max-width: 1400px;
  margin: 0 auto;
}

.login-container {
  max-width: 440px;
  margin: 12vh auto;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 2rem;
  padding: 2rem 2rem 2.5rem;
  box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.login-container h2 {
  font-size: 1.9rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.8rem;
  background: linear-gradient(135deg, #1e293b, #3b82f6);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.login-container input {
  width: 100%;
  padding: 0.9rem 1.2rem;
  margin: 0.7rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 1.2rem;
  font-size: 1rem;
  background: white;
  transition: all 0.2s;
}

.login-container input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.login-container button {
  width: 100%;
  padding: 0.9rem;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.2rem;
  transition: 0.2s;
}

.login-container button:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.error {
  color: #ef4444;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  padding: 1rem 1.8rem;
  border-radius: 2rem;
}

.header h2 {
  font-weight: 600;
  font-size: 1.6rem;
  background: linear-gradient(120deg, #0f172a, #3b82f6);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.logout-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.5rem 1.2rem;
  border-radius: 2rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}

.logout-btn:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
}

.refresh-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1e293b;
}

.refresh-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.add-form {
  background: white;
  padding: 1.2rem 1.5rem;
  border-radius: 1.8rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.05);
}

.add-form input:not(.album-url),
.add-form select {
  flex: 1;
  min-width: 120px;
  padding: 0.8rem 1.2rem;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  font-size: 0.95rem;
  background: #fefefe;
}

.add-form select {
  flex: 0.5;
  min-width: 100px;
  cursor: pointer;
}

.add-form input:focus,
.add-form select:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.add-form button:not(.mode-btn):not(.add-url-btn):not(.remove-url-btn) {
  background: #3b82f6;
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: 2rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.add-form button:not(.mode-btn):not(.add-url-btn):not(.remove-url-btn):hover {
  background: #2563eb;
  transform: scale(0.97);
}

.tag-filter,
.role-filter,
.type-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
  align-items: center;
  padding: 0.2rem 0;
}

.tag-btn,
.role-btn,
.type-btn {
  background: #f1f5f9;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: #334155;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-btn.active {
  background: #3b82f6;
  color: white;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.role-btn.active {
  background: #3b82f6;
  color: white;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.type-btn.active {
  background: #3b82f6;
  color: white;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}


.tag-btn:hover,
.role-btn:hover,
.type-btn:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.tag-count,
.role-count {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 20px;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 500;
  margin-left: 0.2rem;
}

.tag-btn.active .tag-count,
.role-btn.active .role-count {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

.role-link-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.role-link-icon:hover {
  opacity: 1;
}
.role-btn.active .role-link-icon {
  color: white;
}

.role-link-mgr-btn {
  background: #eef2ff !important;
  border: 1px dashed #cbd5e1 !important;
  color: #6366f1 !important;
  font-size: 0.8rem !important;
}
.role-link-mgr-btn:hover {
  background: #e0e7ff !important;
  border-color: #a5b4fc !important;
}

.role-link-dialog {
  max-width: 560px !important;
}
.role-link-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.role-link-tab {
  flex: 1;
  padding: 0.5rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  background: #f8fafc;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.15s;
  color: #475569;
  text-align: center;
}
.role-link-tab.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}
.role-link-tab:hover:not(.active) {
  background: #eef2ff;
}

.role-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-height: 55vh;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding: 0.25rem 0;
}
.role-link-card {
  flex: 0 0 calc(50% - 0.375rem);
  min-width: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 0.75rem;
  transition: 0.15s;
}
.role-link-card:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}
.role-link-card-header {
  margin-bottom: 0.5rem;
}
.role-link-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #0f172a;
}
.role-link-card-body {
  display: flex;
  gap: 6px;
  align-items: center;
}
.role-link-url {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fefefe;
}
.role-link-url:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.remove-url-btn,
.role-link-clear {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
}
.remove-url-btn:hover,
.role-link-clear:hover {
  background: #fecaca;
  transform: scale(1.05);
}
.album-url-row,
.role-link-entry {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.role-link-name-input {
  flex: 0 0 30%;
  min-width: 0;
  padding: 0.6rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fefefe;
}
.role-link-name-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.role-link-add-btn {
  width: 100%;
  margin-top: 6px;
  padding: 0.4rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.7rem;
  background: transparent;
  font-size: 0.8rem;
  color: #64748b;
  cursor: pointer;
  transition: 0.15s;
}
.role-link-add-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.link-pick-list {
  margin-bottom: 1rem;
}
.link-pick-item {
  padding: 0.8rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: 0.15s;
  word-break: break-all;
}
.link-pick-item:hover {
  background: #eef2ff;
  border-color: #3b82f6;
}
.role-link-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 55vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.25rem 0;
}
.role-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eef2ff;
  padding: 0.35rem 0.6rem 0.35rem 0.9rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1e40af;
  cursor: pointer;
  transition: 0.1s;
}
.role-link-chip:hover {
  background: #dbeafe;
}
.role-link-chip-count {
  background: rgba(0,0,0,0.12);
  border-radius: 20px;
  padding: 0.05rem 0.4rem;
  font-size: 0.7rem;
  color: #475569;
}
.role-link-chip-del {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.1s;
  margin-left: 2px;
}
.role-link-chip-del:hover {
  background: #fee2e2;
  color: #dc2626;
}
.role-link-editor-items {
  max-height: 40vh;
  overflow-y: auto;
  margin-bottom: 0.5rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: white;
  border-radius: 1.2rem;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: 260px 240px;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.15);
}

.card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: white;
  z-index: 2;
  pointer-events: none;
}

.media-preview {
  width: 100%;
  aspect-ratio: 16/9;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .media-preview img,
.card:hover .media-preview video {
  transform: scale(1.02);
}

.play-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  pointer-events: none;
}

.card-info.grid-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: start;
  padding: 0.5rem 0.7rem 0.6rem;
}

.card-info-content {
  grid-column: 1;
}

.card-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  margin-top: 0;
}

.roles-row {
  margin-bottom: 0.3rem;
}

.roles-list,
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.tags-list {
  flex: 1;
}

.role {
  background: #d1fae5;
  padding: 0.2rem 0.7rem;
  border-radius: 1.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #065f46;
  cursor: pointer;
  transition: 0.1s;
  line-height: 1.2;
}

.role.active {
  background: #3b82f6;
  color: white;
}

.role:hover {
  background: #a7f3d0;
  transform: scale(1.02);
}

.role.active:hover {
  background: #2563eb;
}

.tag {
  background: #eef2ff;
  padding: 0.2rem 0.7rem;
  border-radius: 1.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #1e40af;
  cursor: pointer;
  transition: 0.1s;
  line-height: 1.2;
}

.tag.active {
  background: #3b82f6;
  color: white;
}

.tag:hover {
  background: #dbeafe;
  transform: scale(1.02);
}

.tag.active:hover {
  background: #2563eb;
}

.more-btn {
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
  color: #64748b;
}

.more-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.action-menu {
  position: fixed;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  z-index: 6000;
  min-width: 140px;
  overflow: hidden;
  animation: menuFadeIn 0.15s ease;
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid #f1f5f9;
}

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

.menu-item:hover {
  background: #f8fafc;
}

.menu-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.menu-item.delete-item {
  color: #dc2626;
}

.menu-item.delete-item svg {
  stroke: #dc2626;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5500;
  cursor: pointer;
}

.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 2rem;
  overflow: hidden;
}

.modal-content img,
.modal-content video {
  max-width: 100%;
  max-height: 85vh;
  display: block;
  border-radius: 1.5rem;
}

.empty-message {
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2rem;
  color: #475569;
  backdrop-filter: blur(4px);
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 8px 16px;
  border-radius: 40px;
  font-size: 14px;
  z-index: 4000;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

.tag-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tag-editor-dialog {
  background: white;
  border-radius: 1.5rem;
  width: 90%;
  max-width: 400px;
  padding: 1.5rem;
  box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.2);
  animation: dialogFadeIn 0.2s ease;
}

@keyframes dialogFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tag-editor-dialog h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #0f172a;
}

.tag-editor-dialog input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
  font-family: inherit;
}

.tag-editor-dialog input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.tag-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
}

.tag-editor-actions button {
  padding: 0.5rem 1.2rem;
  border-radius: 2rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  border: none;
}

.tag-editor-actions .cancel-btn {
  background: #f1f5f9;
  color: #334155;
}

.tag-editor-actions .save-btn {
  background: #3b82f6;
  color: white;
}

.tag-editor-actions .cancel-btn:hover {
  background: #e2e8f0;
}

.tag-editor-actions .save-btn:hover {
  background: #2563eb;
}

.quick-tags-section {
  margin-top: 10px;
}

.quick-tags-label {
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 0.5rem;
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 120px;
  overflow-y: auto;
  padding: 0.2rem 0;
}

.quick-tag {
  background: #e2e8f0;
  padding: 0.3rem 0.8rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: 0.1s;
  color: #1e293b;
}

.quick-tag.selected {
  background: #3b82f6;
  color: white;
}

.quick-tag:hover {
  background: #cbd5e1;
}

.quick-tag-placeholder {
  font-size: 0.75rem;
  color: #94a3b8;
  font-style: italic;
}

.tag-manual-input {
  margin: 10px 0;
}

.tag-manual-input label {
  font-size: 0.8rem;
  color: #475569;
}

.tag-manual-input input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  font-size: 0.9rem;
  margin-top: 5px;
}

/* ========== 图集相关样式 ========== */
.album-pick-list {
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 1rem;
}
.album-pick-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: 0.15s;
  font-weight: 500;
}
.album-pick-item:hover {
  background: #eef2ff;
  border-color: #3b82f6;
}
.album-pick-count {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 400;
}
.album-card {
  cursor: pointer;
}
.album-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.15);
}
.album-badge {
  background: rgba(139, 92, 246, 0.85) !important;
  backdrop-filter: blur(4px);
}
.album-cover-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: rgba(255, 255, 255, 0.8);
  font-size: 2.5rem;
  position: relative;
}
.album-cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}
.album-cover-preview .album-stack-icon {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.album-cover-preview .album-stack-icon svg {
  width: 40px;
  height: 40px;
  opacity: 0.9;
}
.album-cover-preview .album-stack-count {
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(0,0,0,0.4);
  padding: 2px 10px;
  border-radius: 20px;
}
.album-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #0f172a;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-count {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 4px;
}

/* 添加模式切换 */
.add-mode-toggle {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 0.5rem;
}
.mode-btn {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  background: #f8fafc;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  color: #475569;
  text-align: center;
}
.mode-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}
.mode-btn:hover:not(.active) {
  background: #eef2ff;
}
.add-mode-content {
  width: 100%;
}
#albumTitle {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  font-size: 0.95rem;
  background: #fefefe;
  margin-bottom: 0.5rem;
}
#albumTitle:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
#singleMode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
}
.add-url-btn {
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  padding: 0.5rem 1rem;
  border-radius: 1.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  color: #475569;
  width: 100%;
  margin: 0.3rem 0;
}
.add-url-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}
.album-url-row input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  font-size: 0.9rem;
  background: #fefefe;
}
.album-url-row input:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}


/* 图集弹窗 */
.album-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.album-modal-dialog {
  background: white;
  border-radius: 1.5rem;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: dialogFadeIn 0.2s ease;
}
.album-modal-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  background: white;
  border-bottom: 1px solid #f1f5f9;
}
.album-modal-header-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.album-modal-header-left h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
}
.album-modal-count {
  font-size: 0.8rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.2rem 0.7rem;
  border-radius: 1rem;
  font-weight: 500;
}
.album-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
}
.album-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.album-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.5rem 1.5rem;
}
.album-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.album-modal-tags .tag, .album-modal-tags .role {
  font-size: 0.75rem;
}
.album-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

@media (max-width: 720px) {
  body {
    padding: 1rem;
  }

  .header {
    padding: 0.8rem 1rem;
  }

  .header h2 {
    font-size: 1.3rem;
  }

  .add-form {
    padding: 0.8rem 1rem;
    gap: 0.6rem;
  }

  .add-form input,
  .add-form select,
  .add-form button {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .card {
    border-radius: 0.8rem;
  }

  .card-info.grid-layout {
    padding: 0.4rem 0.5rem 0.5rem;
  }

  .tag,
  .role {
    font-size: 0.65rem;
    padding: 0.15rem 0.6rem;
  }

  .more-btn {
    width: 26px;
    height: 26px;
  }

  .play-svg {
    width: 40px;
    height: 40px;
  }

  .action-menu {
    min-width: 130px;
  }

  .menu-item {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .menu-item svg {
    width: 16px;
    height: 16px;
  }

  .tag-editor-dialog {
    padding: 1.2rem;
  }

  .tag-count,
  .role-count {
    font-size: 0.6rem;
    padding: 0.05rem 0.3rem;
  }

  .quick-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }
}

@media (max-width: 480px) {
  .gallery {
    gap: 0.6rem;
  }

  .card-info.grid-layout {
    padding: 0.3rem 0.4rem 0.4rem;
  }

  .tag,
  .role {
    font-size: 0.6rem;
    padding: 0.1rem 0.5rem;
  }

  .more-btn {
    width: 24px;
    height: 24px;
  }

  .play-svg {
    width: 36px;
    height: 36px;
  }

  .tag-count,
  .role-count {
    font-size: 0.55rem;
    padding: 0.05rem 0.25rem;
  }

  .quick-tag {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
  }
  .album-modal-dialog {
    border-radius: 1rem;
    max-height: 85vh;
  }
  .album-modal-header {
    padding: 0.8rem 1rem;
  }
  .album-modal-body {
    padding: 0.8rem 1rem 1rem;
  }
  .album-modal-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
  }
}