:root {
  --bg: #0f1020;
  --bg-2: #1a1b3a;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --text-dim: #9a9bc4;
  --primary: #ff3366;
  --primary-2: #ff7a00;
  --primary-grad: linear-gradient(135deg, #ff3366 0%, #ff7a00 100%);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 0% 0%, rgba(255, 51, 102, 0.18), transparent 60%),
    radial-gradient(1000px 600px at 100% 0%, rgba(255, 122, 0, 0.18), transparent 60%),
    linear-gradient(180deg, #0f1020 0%, #1a1b3a 100%);
  min-height: 100vh;
  background-attachment: fixed;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 18px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Hero */
.hero {
  text-align: center;
  margin-top: 16px;
}

.logo {
  font-size: 32px;
  margin: 0;
  font-weight: 800;
  letter-spacing: 1px;
}

.logo span {
  background: var(--primary-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* Input card */
.input-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.input-row textarea {
  width: 100%;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 80px;
  padding: 8px;
  border-radius: 10px;
  font-family: inherit;
}

.input-row textarea::placeholder {
  color: var(--text-dim);
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.hint {
  margin: 10px 2px 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.6;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* Buttons */
.btn {
  flex: 1;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: var(--primary-grad);
  border: none;
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 51, 102, 0.35);
}

.btn.primary:hover {
  opacity: 0.92;
  background: var(--primary-grad);
}

.btn.big {
  padding: 14px;
  font-size: 15px;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Result */
.result {
  animation: fade-up 0.35s ease both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 70vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-wrap .preview-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.platform-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.duration-tag {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.info {
  padding: 14px;
}

.title {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 700;
  white-space: pre-wrap;
  word-break: break-word;
}

.meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13px;
  flex-wrap: wrap;
}

.link-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.link-label {
  flex-shrink: 0;
}

.direct-link {
  color: #6ab0ff;
  text-decoration: none;
  word-break: break-all;
}

.direct-link:hover {
  text-decoration: underline;
}

.btn-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0 14px 14px;
}

/* Error */
.error {
  background: rgba(255, 51, 102, 0.12);
  border: 1px solid rgba(255, 51, 102, 0.4);
  color: #ffd0dc;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

/* Footer */
.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.7;
  margin-top: 8px;
}

.footer p {
  margin: 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 99;
  animation: toast-in 0.2s ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Desktop tuning */
@media (min-width: 600px) {
  .app {
    padding-top: 48px;
  }
  .logo {
    font-size: 40px;
  }
}
