:root {
  --ink: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --surface: #ffffff;
  --paper: #f9fafb;
  --accent: #f59e0b;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.08), 0 6px 16px rgba(17, 24, 39, 0.08);
  --font: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  width: 380px;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
}

header {
  padding: 14px 14px 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.brand .name { font-weight: 750; font-size: 15px; }
.brand .tag { font-size: 12px; color: var(--muted); margin-top: 2px; }

.actions { display: flex; gap: 8px; }
button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
}
button:hover { filter: brightness(0.98); }
button.secondary { background: transparent; }

.panel {
  margin: 0 14px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
}

.row { display: flex; align-items: center; gap: 10px; }
.label { font-size: 12px; color: var(--muted); width: 110px; }
select {
  flex: 1;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--paper);
}

.meta { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.35; }

.progress { margin: 0 14px 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.progress-top { display: flex; justify-content: space-between; gap: 10px; }
.phase { font-weight: 700; font-size: 12px; }
.counts { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rate { font-size: 12px; color: var(--muted); white-space: nowrap; }
.bar { height: 10px; background: var(--paper); border: 1px solid var(--border); border-radius: 999px; margin-top: 10px; overflow: hidden; }
.fill { height: 100%; width: 0%; background: var(--accent); }

.toolbar { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; }
.pager { display: flex; gap: 6px; align-items: center; }
.page { font-size: 12px; color: var(--muted); }
.export { display: flex; gap: 6px; }

.items { display: grid; gap: 10px; }
.item { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--paper); }
.item .t { font-weight: 650; font-size: 12.5px; margin-bottom: 4px; }
.item .m { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.item a { color: inherit; text-decoration: none; }
.item a:hover { text-decoration: underline; }

.empty { padding: 14px; font-size: 12px; color: var(--muted); text-align: center; }
.hidden { display: none; }

.actionRow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 14px 12px;
}

.actionRow button {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar-bottom {
  margin-top: 10px;
}

@media (max-width: 340px) {
  .actionRow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fab {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 750;
  z-index: 50;
}

.pageSize {
  height: 28px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0 8px;
  font-size: 11px;
}

.debugPanel {
  margin: 10px 14px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 10px 10px;
}

.debugPanel summary {
  cursor: pointer;
  font-weight: 700;
  user-select: none;
  margin: 0 0 8px 0;
}

.debugActions {
  display: flex;
  gap: 8px;
  margin: 8px 0;
  flex-wrap: wrap;
}

.debugLog {
  max-height: 200px;
  overflow: auto;
  background: #0b1220;
  color: #e5e7eb;
  padding: 10px;
  border-radius: 12px;
  font-size: 10px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.versionTag {
  font-weight: 700;
  opacity: 0.85;
  margin-left: 6px;
}
