:root {
  --bg: #0d0f12;
  --surface: #14171c;
  --text: #f0f3f6;
  --muted: #9ca3af;
  --border: #1e2329;
  --accent: #58a6ff;
  --space: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --line: 1.5;
  --row-height: 50px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: var(--line);
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100vh;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
}

.header {
  flex-shrink: 0;
  padding: var(--space-lg) 0 var(--space-md);
  text-align: left;
}
.header.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}
.header-title {
  margin: 0 0 var(--space-md);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}

input[type="search"] {
  flex: 1;
  min-width: 140px;
  padding: var(--space-md) 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
  outline: none;
}
input[type="search"]::placeholder { color: var(--muted); }
input[type="search"]:focus { border-color: var(--accent); outline: none; }

select {
  padding: var(--space-md) var(--space-md);
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  outline: none;
}
select:focus { border-color: var(--accent); }

.status {
  flex-shrink: 0;
  margin: 0 0 var(--space);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.list-viewport {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: var(--space);
}
.list-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.list-scroll::-webkit-scrollbar {
  width: 8px;
}
.list-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.list-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}
.list-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}
.list-inner {
  min-height: 100%;
  position: relative;
}
.list-window {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
}
.list .card {
  flex-shrink: 0;
}

.card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-md);
  align-items: center;
  padding: 0 var(--space-lg);
  border-radius: 0;
  background: var(--surface);
  border: none;
  border-left: 4px solid var(--border);
  height: var(--row-height);
  min-height: var(--row-height);
  max-height: var(--row-height);
  box-sizing: border-box;
  text-align: left;
}
.card:hover {
  background: rgba(20, 23, 28, 0.95);
}

.az-jump {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space) 0;
  max-height: 100%;
  overflow-y: auto;
}
.az-jump[hidden] {
  display: none;
}
.az-jump button {
  width: 24px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.az-jump button:hover {
  color: var(--text);
  background: var(--surface);
}
.az-jump button:disabled {
  opacity: 0.35;
  cursor: default;
}
.az-jump button:disabled:hover {
  background: transparent;
  color: var(--muted);
}
.az-jump button.current {
  font-weight: 700;
  color: var(--text);
}

.card-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.card-icon.no-icon { background: none; }

.card-title-box {
  min-height: 26px;
  border-radius: 4px;
  padding: var(--space) var(--space-md);
  display: flex;
  align-items: center;
  overflow: hidden;
  gap: var(--space);
  text-align: left;
}
.card-title-box.text-dark .card-title { color: #0d1117; }
.card-title-box.text-dark .card-serial { color: #374151; }

.card-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.card-serial {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  flex-shrink: 0;
  text-align: left;
}

button.copy {
  padding: var(--space) var(--space-md);
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 40px;
  text-align: center;
}
button.copy:hover { background: rgba(255,255,255,0.06); border-color: var(--accent); }
button.copy:active { background: rgba(255,255,255,0.1); }

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-lg);
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: var(--space-md) var(--space-lg);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  display: none;
}
.toast.show { display: inline-block; }

@media (max-width: 640px) {
  :root { --row-height: 68px; }
  .wrap { padding: 10px 12px; }
  .header.sticky-bar { padding: var(--space) 12px var(--space); }
  .header-title { font-size: 1.15rem; line-height: 1.3; margin-bottom: var(--space); }
  .controls {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space);
    align-items: center;
  }
  .controls input[type="search"] {
    flex: 1 1 100%;
    min-width: 0;
    padding: var(--space) 10px;
    font-size: 14px;
  }
  .controls select {
    flex: 1 1 0;
    min-width: 0;
    padding: var(--space) 8px;
    font-size: 13px;
  }
  .card {
    grid-template-columns: 24px 1fr auto;
    padding: var(--space) var(--space-md);
    gap: var(--space);
    height: var(--row-height);
    min-height: var(--row-height);
    max-height: var(--row-height);
  }
  .card-icon { width: 24px; height: 24px; }
  .card-title-box { padding: var(--space) var(--space); min-height: 0; overflow: visible; }
  .card-title { font-size: 13px; line-height: 1.4; white-space: normal; overflow: visible; text-overflow: clip; display: block; }
  .card-serial { font-size: 11px; line-height: 1.4; }
  button.copy { min-height: 40px; padding: var(--space) var(--space-md); font-size: 13px; }
}
