:root {
  color-scheme: light;
  --bg: #fff7f8;
  --ink: #232026;
  --muted: #77707b;
  --line: #eadde1;
  --panel: #ffffff;
  --accent: #ff4967;
  --accent-dark: #df254a;
  --soft: #fff0f3;
  --shadow: 0 18px 48px rgba(43, 27, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 237, 241, 0.85), rgba(255, 255, 255, 0.92)),
    var(--bg);
  color: var(--ink);
}

.app {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.panel,
.result,
.status {
  background: var(--panel);
  border: 1px solid rgba(234, 221, 225, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 22px;
}

.brand-row,
.result-head,
.actions,
.media-meta,
.summary {
  display: flex;
  align-items: center;
}

.brand-row,
.result-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
}

.badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #403840;
  font-size: 14px;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 136px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  font: inherit;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 73, 103, 0.12);
}

.actions {
  gap: 10px;
  margin-top: 14px;
}

button,
.download {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button {
  background: var(--accent);
  color: #fff;
}

button:disabled {
  cursor: progress;
  opacity: 0.68;
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

#parseBtn {
  flex: 1;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.status {
  margin-top: 14px;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 14px;
}

.status.error {
  color: #ab1733;
  background: #fff4f5;
  border-color: #ffc8d1;
}

.result {
  margin-top: 16px;
  padding: 18px;
}

.summary {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.summary span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #f5f1f2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.media-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.preview {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #f7f2f4;
}

.preview img,
.preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-meta {
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
}

.media-type {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.download {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 13px;
}

@media (max-width: 380px) {
  .input-panel,
  .result {
    padding: 16px;
  }

  h1 {
    font-size: 24px;
  }

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