/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0b0f1a;
  --surface:      #131929;
  --surface2:     #1a2236;
  --accent:       #39c5bb;
  --accent-dim:   rgba(57, 197, 187, 0.15);
  --accent-hover: rgba(57, 197, 187, 0.30);
  --blue:         #00a3e0;
  --blue-dim:     rgba(0, 163, 224, 0.12);
  --blue-hover:   rgba(0, 163, 224, 0.25);
  --purple:       #a78bfa;
  --purple-dim:   rgba(167, 139, 250, 0.12);
  --text:         #e2e8f0;
  --text-muted:   #7a8fa6;
  --border:       #1f2e45;
  --radius:       8px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Header ────────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 1rem;
}

header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

header h1 span { color: var(--accent); }

.tagline {
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-size: 0.9rem;
}

.notice-bar {
  max-width: 100%;
  background: rgba(57, 197, 187, 0.07);
  border-top: 1px solid rgba(57, 197, 187, 0.13);
  padding: 0.55rem 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
}

.notice-bar a { font-weight: 500; color: var(--accent); }

.notice-label {
  background: var(--accent);
  color: #000;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.notice-sep { color: var(--border); }

/* ─── Main ──────────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* ─── Filters ───────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.75rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  width: 56px;
  flex-shrink: 0;
}

.filter-label-wide {
  width: 76px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.32rem 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  font-family: inherit;
}

.tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

/* ─── Search ────────────────────────────────────────────────── */
.search-box {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.32rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: inherit;
  width: 220px;
  transition: border-color 0.12s;
  outline: none;
}

.search-box::placeholder { color: var(--text-muted); }

.search-box:focus {
  border-color: var(--accent);
}

/* ─── Count line ─────────────────────────────────────────────── */
.item-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ─── Catalog grid ──────────────────────────────────────────── */
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.empty {
  color: var(--text-muted);
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem;
  font-size: 0.95rem;
}

/* ─── Card ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--accent); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.card-badges {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.42rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-version {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(0, 163, 224, 0.22);
}

.badge-type.software {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid rgba(167, 139, 250, 0.22);
}

.badge-type.voicebank {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(57, 197, 187, 0.22);
}

.card-desc {
  font-size: 0.855rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.card-links {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.btn {
  display: inline-block;
  padding: 0.38rem 0.85rem;
  border-radius: 6px;
  font-size: 0.79rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.12s;
  white-space: nowrap;
}

.btn-torrent {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(57, 197, 187, 0.28);
}

.btn-torrent:hover:not(.disabled) { background: var(--accent-hover); }

.btn-magnet {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(0, 163, 224, 0.22);
}

.btn-magnet:hover:not(.disabled) { background: var(--blue-hover); }

.btn-direct {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid rgba(167, 139, 250, 0.22);
}

.btn-direct:hover:not(.disabled) { background: rgba(167, 139, 250, 0.25); }

.btn.disabled {
  opacity: 0.28;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Footer ────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  header h1 { font-size: 1.5rem; }
  .header-inner { padding: 1rem 1rem 0.75rem; }
  .notice-bar { padding: 0.5rem 1rem; }
  main { padding: 1.25rem 1rem; }
  .filter-label { width: auto; min-width: 52px; }
  .filter-label-wide { width: auto; }
  .search-box { width: 100%; }
  .catalog { grid-template-columns: 1fr; }
}
