:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --fg: #16181d;
  --muted: #7b8290;
  --line: #ebedf0;
  --hover: #f7f8fa;
  --accent: #fe2c55;
  --accent-ink: #ffffff;
  --error: #d32029;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --panel: #16181d;
    --fg: #e9ecf2;
    --muted: #8b93a1;
    --line: #23262d;
    --hover: #1c1f25;
    --accent: #fe2c55;
    --accent-ink: #ffffff;
    --error: #ff6b74;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}

body {
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* header ---------------------------------------------------------------- */

header {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  letter-spacing: .2px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}

/* layout ---------------------------------------------------------------- */

main {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

h1 {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.2px;
}

/* input ----------------------------------------------------------------- */

.field {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
  transition: box-shadow .15s;
}

.field:focus-within { box-shadow: 0 0 0 4px rgba(254, 44, 85, .12); }

#input {
  flex: 1;
  min-height: 52px;
  max-height: 180px;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  line-height: 1.5;
  resize: none;
  outline: none;
}

#input::placeholder { color: var(--muted); }

#submit {
  width: 104px;
  border: 0;
  border-radius: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s;
}

#submit:hover { filter: brightness(1.05); }
#submit:disabled { filter: grayscale(.4); opacity: .6; cursor: default; }

/* status ---------------------------------------------------------------- */

#status {
  min-height: 20px;
  margin: 10px 2px 0;
  font-size: 13px;
  color: var(--muted);
}

/* supported platforms: one quiet row, no boxes, no scrolling --------------- */

.platforms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 14px 0 0;
  padding: 0 2px;
  font-size: 12px;
  color: var(--muted);
}

.platforms span { white-space: nowrap; }

.platforms .off { opacity: .55; }

.platforms span:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-left: 12px;
  margin-bottom: 3px;
  border-radius: 50%;
  background: var(--line);
}

#status.error { color: var(--error); }

#turnstile:empty { display: none; }
#turnstile { margin-top: 14px; }

/* result card ----------------------------------------------------------- */

#results { margin-top: 28px; display: grid; gap: 18px; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.card-head {
  display: flex;
  gap: 14px;
  padding: 16px;
}

.cover {
  width: 148px;
  height: 84px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: #000;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  line-height: 18px;
}

/* quality rows ---------------------------------------------------------- */

.quality {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.quality:hover { background: var(--hover); }
.quality[disabled] { opacity: .55; cursor: default; }

.q-name { min-width: 96px; font-weight: 600; font-size: 14px; }
.q-note { flex: 1; font-size: 12px; color: var(--muted); }
.q-size { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.q-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--hover);
  color: var(--accent);
  font-size: 14px;
}

.q-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width .2s;
}

/* footer ---------------------------------------------------------------- */

footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.copy {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 56px;
  font-size: 12px;
  color: var(--muted);
}

.copy a {
  color: inherit;
  text-decoration: none;
}

.copy a:hover { color: var(--fg); text-decoration: underline; }

/* cookie notice --------------------------------------------------------- */

.cookie {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.cookie[hidden] { display: none; }

.cookie a {
  color: var(--accent);
  text-decoration: none;
}

.cookie button {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.cookie button:hover { border-color: var(--accent); }

footer a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

footer a:hover { color: var(--fg); }

@media (max-width: 560px) {
  main { padding: 32px 16px 56px; }
  h1 { font-size: 20px; }
  #submit { width: 84px; }
  .cover { width: 108px; height: 62px; }
  .q-name { min-width: 74px; }
}
