/**
 * Modown Linear — 智能标题封面（对齐 /downvideo）
 * 作用域：.la-title
 */

.la-title-main {
  min-height: calc(100svh - 100px);
  background: var(--linear-bg, #000) !important;
  display: flex;
  flex-direction: column;
}

.la-title-main > .container {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 140px 24px 72px;
  flex: 1;
  display: flex;
  align-items: flex-start;
}

.la-title {
  --ty-accent: #727be3;
  --ty-accent-soft: rgba(114, 123, 227, 0.16);
  --ty-accent-border: rgba(114, 123, 227, 0.45);
  --ty-panel: #1a1a1c;
  --ty-panel-2: #222226;
  --ty-line: rgba(255, 255, 255, 0.1);
  --ty-text: #ffffff;
  --ty-muted: #8b8b90;

  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  color: var(--ty-text);
}

/* 主页结果区在 .la-title 外，变量挂到整块功能区 */
.la-fn {
  --ty-accent: #727be3;
  --ty-accent-soft: rgba(114, 123, 227, 0.16);
  --ty-accent-border: rgba(114, 123, 227, 0.45);
  --ty-panel: #1a1a1c;
  --ty-panel-2: #222226;
  --ty-line: rgba(255, 255, 255, 0.1);
  --ty-text: #ffffff;
  --ty-muted: #8b8b90;
}

.la-title__headline {
  margin: 0 0 0.35rem;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--ty-text);
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  line-height: 1.2;
}

.la-title__headline-sub {
  display: inline;
  margin-left: 0.15em;
  font-size: 0.666em;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: baseline;
  color: var(--ty-muted);
}

.la-title__tip {
  margin: -0.35rem 0 0.15rem;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ty-muted);
  text-align: center;
}

.la-title__tip-badge {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--ty-accent);
  color: #000;
  font-weight: 800;
  font-size: 12px;
  line-height: 1.35;
  vertical-align: 1px;
}

.la-title__platform {
  font-weight: 600;
  color: var(--ty-accent);
}

.la-title__platform--cover {
  color: #ff2442;
}

.la-title__composer {
  width: 100%;
  background: var(--ty-panel);
  border: 1px solid var(--ty-line);
  border-radius: 18px;
  padding: 1rem 1.05rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: none !important;
}

.la-title__input {
  width: 100%;
  min-height: 80px;
  resize: none;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--ty-text) !important;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  padding: 0.25rem 0.2rem 0;
}

.la-title__input::placeholder {
  color: var(--ty-muted);
  font-size: 14px;
}

.la-title__extra {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.la-title__extra[hidden] {
  display: none !important;
}

.la-title__row {
  width: 100%;
  border: 1px solid var(--ty-line);
  background: rgba(0, 0, 0, 0.28);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ty-text);
  font: inherit;
  font-size: 13.5px;
  outline: none;
}

.la-title__file {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 12.5px;
  color: var(--ty-muted);
}

.la-title__file input[type="file"] {
  font-size: 12.5px;
  color: var(--ty-muted);
}

.la-title__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.la-title__seg {
  display: inline-flex;
  padding: 3px;
  background: #161618;
  border-radius: 10px;
  border: 1px solid var(--ty-line);
}

.la-title__seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ty-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  min-width: 84px;
  padding: 0.4rem 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.la-title__seg button.is-active {
  background: var(--ty-panel-2);
  color: #fff;
}

.la-title__submit {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: #3a3a3e;
  color: #9a9a9e;
  display: grid;
  place-items: center;
  cursor: not-allowed;
  transition: background 0.2s ease, color 0.2s ease, filter 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  padding: 0;
  position: relative;
}

.la-title__submit.is-ready {
  background: #7b89eb;
  color: #fff;
  cursor: pointer;
}

.la-title__submit.is-ready:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.la-title__submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.la-title__submit.is-loading {
  opacity: 1;
  background: #3a3a3e;
  color: #c8c8cc;
  cursor: wait;
  filter: none;
  transform: none;
}

.la-title__submit.is-loading.is-ready {
  background: #3a3a3e;
  color: #c8c8cc;
}

.la-title__submit:not(.is-ready):hover {
  filter: none;
  transform: none;
}

.la-title__submit svg {
  width: 18px;
  height: 18px;
}

.la-title__submit.is-loading svg {
  opacity: 0;
}

.la-title__submit.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  animation: la-ty-spin 0.75s linear infinite;
}

@keyframes la-ty-spin {
  to {
    transform: rotate(360deg);
  }
}

.la-title__foot {
  text-align: center;
}

.la-title__hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--ty-muted);
}

.la-title__quota {
  margin: 0.35rem 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #c8c8cc;
}

.la-title__quota b {
  color: var(--ty-accent);
  font-weight: 700;
}

.la-title__quota-note {
  display: inline-block;
  margin-left: 0.45rem;
  color: var(--ty-muted);
  font-size: 12px;
}

.la-title__status {
  margin: 0;
  min-height: 1.2em;
  font-size: 12.5px;
  color: var(--ty-muted);
  text-align: center;
}

.la-title__status.is-wait {
  color: #c9c4ff;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.la-title__status.is-wait:has(.la-loading-dots)::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(114, 123, 227, 0.25);
  border-top-color: #727be3;
  animation: la-ty-spin 0.75s linear infinite;
  flex: 0 0 auto;
}

.la-title__status.is-error {
  color: #ff6b6b;
}

.la-title__status.is-ok {
  color: #8ad7a0;
}

.la-loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
  min-width: 1.1em;
  height: 1em;
  vertical-align: middle;
}

.la-loading-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  animation: la-dot-pulse 1.05s ease-in-out infinite;
}

.la-loading-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.la-loading-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes la-dot-pulse {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.la-title__results {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.2rem;
}

.la-title__results[hidden] {
  display: none !important;
}

.la-title__results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.la-title__results-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ty-muted);
  background: none !important;
  border: 0 !important;
}

.la-title__ghost {
  appearance: none;
  border: 1px solid var(--ty-line);
  background: transparent;
  color: var(--ty-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.la-title__ghost:hover {
  background: var(--ty-accent-soft);
  color: #fff;
}

.la-title__ghost[hidden] {
  display: none !important;
}

.la-title__list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.la-title__list--covers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.la-title__cover-item {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--ty-line);
  background: #111;
}

.la-title__cover-item--inline {
  max-width: 160px;
}

.la-title__cover-view {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: zoom-in;
  background: #111;
}

.la-title__cover-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
  border-radius: 0;
  max-width: none;
}

.la-title__cover-dl {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.la-title__cover-dl:hover {
  background: rgba(0, 0, 0, 0.78);
  transform: scale(1.05);
}

.la-title__cover-dl svg {
  width: 14px;
  height: 14px;
}

.la-title__card-cover--inline {
  flex-basis: 100%;
}

body.la-title-lightbox-open {
  overflow: hidden;
}

.la-title__lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.la-title__lightbox[hidden] {
  display: none !important;
}

.la-title__lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}

.la-title__lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 520px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.la-title__lightbox-img {
  max-width: 100%;
  max-height: calc(92vh - 80px);
  width: auto;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--ty-line);
  background: #111;
  object-fit: contain;
}

.la-title__lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.la-title__lightbox-dl {
  min-width: 88px;
  text-align: center;
  text-decoration: none;
}

.la-title__card {
  background: var(--ty-panel);
  border: 1px solid var(--ty-line);
  border-radius: 14px;
  padding: 0.75rem 0.85rem 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  text-align: left;
}

.la-title__card-text {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ty-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.la-title__card-actions {
  display: flex;
  flex-shrink: 0;
  align-self: center;
  align-items: center;
  gap: 0.45rem;
}

.la-title__cover-btn {
  appearance: none;
  border: 1px solid var(--ty-line);
  background: var(--ty-panel-2);
  color: #c8c8cc;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  height: 34px;
  padding: 0 0.85rem;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.la-title__cover-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  color: #fff;
}

.la-title__cover-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.la-title__cover-btn.is-loading {
  opacity: 1;
  cursor: wait;
}

.la-title__card-cover {
  width: 100%;
  margin-top: 0.15rem;
}

.la-title__card-cover[hidden] {
  display: none !important;
}

.la-title__card-cover img {
  display: block;
  width: min(100%, 280px);
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--ty-line);
  background: #111;
}

.la-title__card-cover .la-title__cover-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  max-width: none;
}

.la-title__copy {
  appearance: none;
  flex-shrink: 0;
  border: 1px solid var(--ty-accent-border);
  background: var(--ty-accent-soft);
  color: var(--ty-accent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  height: 34px;
  padding: 0 0.95rem;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease, filter 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.la-title__copy:hover {
  filter: brightness(1.08);
}

.la-title__copy.is-done {
  border-color: rgba(109, 222, 168, 0.45);
  color: #6ddea8;
  background: rgba(109, 222, 168, 0.12);
  filter: none;
}

@media (max-width: 720px) {
  .la-title-main > .container {
    padding: 96px 16px 56px;
  }

  .la-title__headline {
    font-size: 1.75rem;
  }

  .la-title__list--covers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
