:root {
  --bg: #0f0f17;
  --panel: #171724;
  --panel2: #1f1f30;
  --line: #2b2b40;
  --text: #ececf4;
  --muted: #9a9ab3;
  --accent: #8f78ff;
  --accent2: #6d55d9;
  --danger: #ef4444;
  --ok: #22c55e;
  --voteUp: #22c55e;
  --voteDown: #ef4444;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
button { font: inherit; color: inherit; }
input, select { font: inherit; }
img { display: block; }
.ico { width: 1em; height: 1em; vertical-align: -0.15em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  padding: .55em 1em; border-radius: 10px; cursor: pointer; font-weight: 600; line-height: 1.1;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: #44445f; background: #27273b; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #c53030; border-color: #c53030; }
.btn-icon { padding: .45em .6em; min-width: 2.3em; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px; backdrop-filter: blur(3px);
}
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px;
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal h3 { margin: 0 0 .5em; font-size: 1.25rem; }
.modal p { color: var(--muted); margin: 0 0 1em; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal.confirm .btn { padding: .8em 1.4em; }

#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 2000; pointer-events: none; }
.toast {
  background: #26263a; border: 1px solid var(--line); color: var(--text); padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; max-width: 90vw;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { border-color: var(--danger); background: #3a1d22; }
.toast-ok { border-color: var(--ok); background: #183326; }

.votebadge { display: inline-flex; gap: .6em; font-size: .8rem; font-weight: 700; }
.votebadge .up { color: var(--voteUp); }
.votebadge .down { color: var(--voteDown); }
.votebadge .ico { margin-right: .2em; }

.cover { border-radius: 8px; object-fit: cover; background: #2a2a3d; flex: none; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muted { color: var(--muted); }
.tag {
  display: inline-block; font-size: .7rem; font-weight: 700; padding: .15em .5em; border-radius: 999px;
  background: #2c2c44; color: var(--muted); letter-spacing: .02em; white-space: nowrap;
}
.tag-warn { background: #3d3317; color: #f5c451; }
.tag-accent { background: rgba(143,120,255,.18); color: #b9a9ff; }
.tag-ok { background: rgba(34,197,94,.15); color: #6ee7a0; }
