:root {
  --bg: #0f1115;
  --panel: #181b22;
  --panel-2: #20242d;
  --text: #e8ecf2;
  --muted: #8b94a3;
  --accent: #ffb84d;
  --accent-strong: #ff9b1a;
  --danger: #e25c5c;
  --border: #2a2f3a;
  --radius: 10px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 18px 80px;
}

header h1 {
  margin: 0 0 4px;
  font-size: 1.8rem;
  letter-spacing: -0.01em;
}
.tagline { color: var(--muted); margin: 0 0 22px; }

.muted { color: var(--muted); }

.suggest-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}

input[type="text"] {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  outline: none;
}
input[type="text"]:focus { border-color: var(--accent); }

.search-wrap { position: relative; }
.results {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  position: absolute;
  left: 0; right: 0;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: var(--shadow);
}
.results li {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.results li:last-child { border-bottom: 0; }
.results li:hover, .results li.active { background: rgba(255, 184, 77, 0.08); }
.results img {
  width: 36px; height: 54px;
  object-fit: cover;
  background: #333;
  border-radius: 4px;
  flex-shrink: 0;
}
.results .r-meta { display: flex; flex-direction: column; min-width: 0; }
.results .r-title {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.results .r-sub { font-size: 0.78rem; color: var(--muted); }

.picked {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}
.picked img {
  width: 60px; height: 90px;
  object-fit: cover; background: #333;
  border-radius: 4px;
  flex-shrink: 0;
}
.picked-meta { flex: 1; min-width: 0; }
.picked-meta strong { display: block; }
.picked-meta p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-btn {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}

button#submit {
  background: var(--accent);
  color: #1a1208;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
button#submit:disabled {
  background: #3a3f4a;
  color: var(--muted);
  cursor: not-allowed;
}
button#submit:not(:disabled):hover { background: var(--accent-strong); }

.msg { margin: 0; font-size: 0.85rem; }
.msg.ok { color: #6dd38c; }
.msg.err { color: var(--danger); }

.list-section { margin-top: 32px; }
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.list-header h2 { margin: 0; font-size: 1.15rem; }
.sort { display: flex; gap: 4px; }
.sort-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  cursor: pointer;
}
.sort-btn.active { color: var(--text); border-color: var(--accent); }

.suggestions { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.s-item {
  display: flex;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  align-items: flex-start;
}
.s-item img {
  width: 56px; height: 84px;
  object-fit: cover; background: #333;
  border-radius: 4px;
  flex-shrink: 0;
}
.s-meta { flex: 1; min-width: 0; }
.s-title { font-weight: 600; }
.s-sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.s-by { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.s-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.s-vote button {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  width: 44px; height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.s-vote button:hover { border-color: var(--accent); }
.s-vote button.voted {
  background: var(--accent);
  color: #1a1208;
  border-color: var(--accent);
}
.s-vote .count { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 480px) {
  header h1 { font-size: 1.5rem; }
  main { padding: 18px 12px 60px; }
}
