:root {
  --bg: #0b0f19;
  --panel: rgba(255,255,255,.04);
  --border: rgba(255,255,255,.10);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --radius: 16px;
  --accent: rgba(120,140,255,.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, var(--accent), transparent 60%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 18px 120px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.top { 
  display: flex; 
  justify-content: space-between; 
  align-items: flex-end; 
  gap: 18px; 
  flex-wrap: wrap;
  margin-bottom: 10px;
}

h1 { margin: 0; font-size: 28px; }
.status { color: var(--muted); font-size: 14px; }

.gridHeader > div {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
  position: relative;
}

.gridHeader > div:hover {
  color: #fff;
}

.gridHeader > div::after {
  content: ' ↕';
  font-size: 12px;
  color: var(--muted);
  opacity: 0.3;
  margin-left: 5px;
  transition: all 0.2s;
}

.gridHeader > div:hover::after {
  opacity: 1;
  color: #fff;
}

.controls { 
  display: flex; 
  gap: 12px; 
  align-items: center; 
  flex: 1; 
  justify-content: flex-end; 
}

.search-group {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  flex: 1;
  max-width: 500px;
}

.search-group select, .search-group input {
  background: transparent;
  color: var(--text);
  border: none;
  padding: 10px 15px;
  font-size: 14px;
  outline: none;
}

.search-group select { border-right: 1px solid var(--border); }

#typeFilter {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 35px 10px 15px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

.tableWrap {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius: var(--radius);
  overflow: auto;
}

.gridTable { width: 100%; min-width: 750px; border-collapse: collapse; }

.gridHeader, .gridRow {
  display: grid !important;
  grid-template-columns: 1fr 250px 100px 150px 50px !important;
  gap: 15px;
  align-items: center;
  padding: 0 20px;
}

.gridHeader {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #111524;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.15);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  padding-top: 20px; 
  padding-bottom: 20px;
}

.gridRow {
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.06);
}

.gridRow > div:first-child {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 0;
}

.cover {
  width: 44px; height: 66px; flex: 0 0 44px;
  border-radius: 6px; object-fit: cover;
  border: 1px solid var(--border);
}

.titleLink { 
  color: inherit; 
  text-decoration: none; 
  font-weight: 600;
  word-break: break-word;
}

.titleLink:hover {
  text-decoration: underline;
}

.detailCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  margin-top: 20px;
}

.detailGrid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
}

.bigCover {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.detailMetaLine {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.kvs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 25px 0;
}

.kv {
  display: flex;
  gap: 15px;
  font-size: 14px;
}

.kv b {
  width: 100px;
  color: var(--muted);
}

.btn.primary {
  display: inline-block;
  background: #3b82f6;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 20px;
}

.desc {
  line-height: 1.6;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.backLink {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 15px;
  transition: color 0.2s;
}

.backLink:hover {
  color: var(--text);
  text-decoration: underline;
  opacity: 0.8;
}

@media (max-width: 740px) {
  .gridHeader, .gridRow { 
    grid-template-columns: 1.2fr 100px !important; 
    gap: 10px;
  }

  .gridHeader div:nth-child(n+3), 
  .gridRow div:nth-child(n+3) { 
    display: none; 
  }

  .gridHeader div:nth-child(2) {
    text-align: left;
  }

  .top { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 15px;
  }

  .controls { 
    width: 100%; 
    justify-content: space-between; 
    gap: 8px;
  }

  .detailGrid { grid-template-columns: 1fr; }
  .bigCover { max-width: 200px; margin: 0 auto; }
}