:root {
  --bg-top: #fff7ec;
  --bg-bottom: #ffe0c7;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --line: rgba(201, 113, 41, 0.18);
  --text: #2f1f13;
  --muted: #7a5c49;
  --accent: #d14d24;
  --accent-deep: #a73d1a;
  --accent-soft: #fff1e8;
  --success: #17795d;
  --shadow: 0 18px 50px rgba(152, 72, 25, 0.14);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --font-main: "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-main);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95) 0, rgba(255, 255, 255, 0) 35%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.desktop-only {
  display: none;
}

.desktop-card {
  width: min(560px, calc(100% - 32px));
  padding: 40px 32px;
  border: 1px solid rgba(209, 77, 36, 0.12);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
}

.desktop-card h1 {
  margin: 18px 0 12px;
  font-size: 34px;
}

.desktop-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

body.is-desktop {
  padding: 0;
}

body.is-desktop .mobile-only {
  display: none !important;
}

body.is-desktop .desktop-only {
  display: block;
  min-height: 100vh;
}

img,
video {
  display: block;
  max-width: 100%;
}

button,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 60px;
}

.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding: 34px;
  border: 1px solid rgba(209, 77, 36, 0.12);
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(255, 244, 236, 0.98), rgba(255, 255, 255, 0.92)),
    linear-gradient(135deg, rgba(209, 77, 36, 0.1), rgba(209, 77, 36, 0));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(209, 77, 36, 0.18), rgba(209, 77, 36, 0));
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(209, 77, 36, 0.08);
  color: var(--accent-deep);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 18px 0 12px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
}

.hero p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.panel--input,
.panel--result {
  padding: 26px;
}

.panel__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.panel__head h2 {
  margin: 0;
  font-size: 24px;
}

.panel__head span {
  color: var(--muted);
  font-size: 14px;
}

.field {
  display: block;
}

.field span {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 180px;
  padding: 18px;
  border: 1px solid rgba(209, 77, 36, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
  border-color: rgba(209, 77, 36, 0.48);
  box-shadow: 0 0 0 4px rgba(209, 77, 36, 0.12);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 14px 28px rgba(167, 61, 26, 0.24);
}

.btn--ghost {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.status {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 14px;
}

.status--loading {
  color: var(--accent-deep);
  background: rgba(255, 241, 232, 0.95);
}

.status--success {
  color: var(--success);
  background: rgba(235, 250, 244, 0.95);
}

.status--error {
  color: #b42318;
  background: rgba(254, 243, 242, 0.95);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  border: 1px dashed rgba(209, 77, 36, 0.2);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 245, 237, 0.96));
  text-align: center;
  padding: 24px;
}

.empty-state strong {
  font-size: 22px;
}

.empty-state p {
  margin: 12px 0 0;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.8;
}

.hidden {
  display: none !important;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.result__meta {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
}

.cover-wrap {
  border-radius: 24px;
  overflow: hidden;
  background: #f4e1d3;
  aspect-ratio: 3 / 4;
}

.cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meta-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.type-tag {
  align-self: flex-start;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(209, 77, 36, 0.1);
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 700;
}

.meta-text h3 {
  margin: 14px 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.25;
}

.meta-text p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.resource-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 700;
}

.resource-links .resource-button {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(167, 61, 26, 0.2);
}

.resource-links .resource-button:hover {
  transform: translateY(-1px);
}

.gallery-actions {
  margin-bottom: 16px;
}

.gallery-download-button {
  appearance: none;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(167, 61, 26, 0.2);
}

.raw-links-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.raw-link-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(209, 77, 36, 0.12);
}

.raw-link-label {
  margin-bottom: 0;
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 700;
}

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

.raw-link-button {
  appearance: none;
  border: 0;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.raw-link-button--ghost {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.result-block {
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(209, 77, 36, 0.12);
}

.block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.block-title h4 {
  margin: 0;
  font-size: 18px;
}

#videoPlayer {
  width: 100%;
  max-height: 640px;
  border-radius: 20px;
  background: #000;
}

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

.gallery-card {
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface-strong);
  border: 1px solid rgba(209, 77, 36, 0.12);
  display: flex;
  flex-direction: column;
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 1 / 1.15;
  object-fit: cover;
}

.gallery-card-actions {
  display: flex;
  gap: 10px;
  padding: 12px;
}

.gallery-card-button {
  appearance: none;
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.gallery-card-button--ghost {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .result__meta {
    grid-template-columns: 1fr;
  }

  .cover-wrap {
    max-width: 320px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 18px;
    padding-bottom: 30px;
  }

  .hero,
  .panel--input,
  .panel--result {
    padding: 20px;
    border-radius: 24px;
  }

  .actions {
    flex-direction: column;
  }

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