/**
 * Modown Linear — 抖音视频下载页样式
 * 参考：深色精致控件 + 图3 蓝紫强调色
 * 作用域：.la-douyin
 */

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

.la-douyin-main > .container {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 220px 24px 72px; /* 下移累计 180px */
  flex: 1;
  display: flex;
  align-items: flex-start;
}

.la-douyin {
  /* 图3 蓝紫 */
  --dy-accent: #727be3;
  --dy-accent-soft: rgba(114, 123, 227, 0.16);
  --dy-accent-border: rgba(114, 123, 227, 0.45);
  --dy-panel: #1a1a1c;
  --dy-panel-2: #222226;
  --dy-line: rgba(255, 255, 255, 0.1);
  --dy-text: #ffffff;
  --dy-muted: #8b8b90;
  --dy-danger: #ff6b6b;

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

/* 标题：放大加粗，其余文字都更小 */
.la-douyin__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(--dy-text);
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  line-height: 1.2;
}

.la-douyin__headline-sub {
  display: inline;
  margin-left: 0.15em;
  font-size: 0.666em; /* 约为「无水印下载」的 2/3，即小三分之一 */
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: baseline;
  color: var(--dy-muted);
}

.la-douyin__headline em {
  font-style: normal;
  color: var(--dy-accent);
  font-weight: 800;
}

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

.la-douyin__platforms > span:not(.la-douyin__platforms-tip) {
  font-weight: 600;
}

.la-douyin__platform-dy {
  color: var(--dy-accent);
}

.la-douyin__platform-xhs {
  color: #ff2442;
}

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

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

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

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

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

.la-douyin__toolbar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
}

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

.la-douyin__seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dy-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-douyin__seg button.is-active {
  background: var(--dy-panel-2);
  color: #fff;
}

.la-douyin__opt {
  appearance: none;
  border: 1px solid var(--dy-line);
  background: var(--dy-panel-2);
  color: var(--dy-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  height: 36px;
  min-width: 86px;
  padding: 0 0.95rem;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.la-douyin__ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.la-douyin__opt:hover {
  color: #e8e8ea;
  border-color: rgba(255, 255, 255, 0.16);
}

.la-douyin__opt.is-active {
  background: var(--dy-accent-soft);
  border-color: var(--dy-accent-border);
  color: var(--dy-accent);
}

.la-douyin__opt.is-hidden,
.la-douyin__recent.is-hidden {
  display: none !important;
}

.la-douyin__opt.is-locked {
  cursor: default;
  pointer-events: none;
  user-select: none;
}

.la-douyin__opt.is-vip-only {
  opacity: 0.55;
  position: relative;
}

.la-douyin__opt.is-vip-only::after {
  content: "VIP";
  margin-left: 0.25rem;
  font-size: 10px;
  font-weight: 700;
  color: #fbb715;
}

.la-douyin__foot {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.la-douyin__hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--dy-muted);
}

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

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

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

.la-douyin__status {
  margin: 0.15rem 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #d0d0d4;
  max-width: 36rem;
}

.la-douyin__status.is-error {
  color: var(--dy-danger);
}

.la-douyin__status.is-ok {
  color: #6ddea8;
}

.la-douyin__status.is-wait {
  color: #c9c4ff;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.la-douyin__status.is-wait::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(114, 123, 227, 0.25);
  border-top-color: var(--dy-accent);
  animation: la-dy-spin 0.75s linear infinite;
  flex: 0 0 auto;
}

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

.la-douyin__recent {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 36px;
  min-width: 140px;
  padding: 0 0.85rem;
  border-radius: 10px;
  background: var(--dy-panel-2);
  border: 1px solid var(--dy-line);
  color: #c8c8cc;
  font-size: 12.5px;
}

.la-douyin__recent input {
  width: 2.4rem;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--dy-accent) !important;
  font: inherit;
  font-weight: 600;
  font-size: 12.5px;
  text-align: center;
  border-bottom: 1px solid var(--dy-accent-border) !important;
  padding: 0;
  height: auto;
  border-radius: 0;
}

.la-douyin__recent input::-webkit-outer-spin-button,
.la-douyin__recent input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.la-douyin__recent input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.la-douyin__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;
}

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

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

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

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

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

.la-douyin__results {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

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

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

.la-douyin__results-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #d0d0d4;
  background: none !important;
  border: 0 !important;
}

.la-douyin__ghost {
  appearance: none;
  border: 1px solid var(--dy-line);
  background: transparent;
  color: var(--dy-accent);
  font: inherit;
  font-size: 12.5px;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
}

.la-douyin__ghost:hover {
  background: var(--dy-accent-soft);
}

.la-douyin__ghost:disabled {
  opacity: 0.5;
  cursor: wait;
}

.la-douyin__item {
  background: var(--dy-panel);
  border: 1px solid var(--dy-line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
}

.la-douyin__item-title {
  font-size: 13.5px;
  margin-bottom: 0.4rem;
  color: #e8e8ea;
  line-height: 1.45;
}

.la-douyin__item-meta {
  font-size: 12px;
  color: var(--dy-muted);
  margin-bottom: 0.35rem;
}

.la-douyin__item-actions {
  margin: 0.35rem 0 0.55rem;
}

.la-douyin__transcript {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--dy-border, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.la-douyin__transcript-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.la-douyin__transcript-name {
  flex: 1 1 8rem;
  min-width: 0;
  font-size: 12px;
  color: var(--dy-muted, rgba(255, 255, 255, 0.55));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.la-douyin__transcript-actions {
  display: flex;
  gap: 0.4rem;
}

.la-douyin__transcript-text {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 8rem;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--dy-border, rgba(255, 255, 255, 0.12));
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
}

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

.la-douyin__dl-video:hover:not(:disabled) {
  filter: brightness(1.08);
}

.la-douyin__dl-video:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.la-douyin__dl-video.is-done {
  border-color: rgba(109, 222, 168, 0.45);
  color: #6ddea8;
}

.la-douyin__ghost.is-hidden {
  display: none !important;
}

.la-douyin__files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.la-douyin__file {
  appearance: none;
  border: 1px solid var(--dy-accent-border);
  background: var(--dy-accent-soft);
  color: var(--dy-accent);
  font: inherit;
  font-size: 12px;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}

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

.la-douyin__file.is-done {
  color: #8ad7a0;
  border-color: rgba(138, 215, 160, 0.35);
  background: rgba(138, 215, 160, 0.1);
}

@media (max-width: 720px) {
  .la-douyin-main > .container {
    padding: 204px 16px 56px; /* 下移累计 180px */
    max-width: 100%;
  }

  .la-douyin__headline {
    font-size: clamp(1.7rem, 7vw, 2.2rem);
  }

  .la-douyin__composer {
    border-radius: 16px;
    padding: 0.9rem 0.85rem 0.8rem;
  }

  .la-douyin__input {
    min-height: 80px;
    font-size: 14px;
  }

  .la-douyin__toolbar {
    align-items: stretch;
  }

  .la-douyin__toolbar-left {
    width: 100%;
  }

  .la-douyin__submit {
    margin-left: auto;
  }
}
