:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --line: #d8dee8;
  --accent: #2563eb;
  --accent-weak: #e8f0ff;
  --danger: #b42318;
  --code-bg: #101828;
  --code-text: #e6edf6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 58px;
  padding: 0 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  font-weight: 700;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a,
.toolbar a,
.download-form button,
.search-form button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.nav a.active,
.toolbar a.active {
  border-color: var(--accent);
  background: var(--accent-weak);
  color: var(--accent);
}

.user {
  color: var(--muted);
  font-size: 14px;
}

.page {
  width: min(1180px, calc(100vw - 32px));
  margin: 28px auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  padding: 22px;
}

.service-card {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
}

.service-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.service-card span {
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.file-name {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.download-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.log-view,
.match pre {
  margin: 0;
  padding: 18px;
  background: var(--code-bg);
  color: var(--code-text);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.download-form input,
.search-form input {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
}

.download-form button,
.search-form button {
  cursor: pointer;
}

.matches {
  display: grid;
  gap: 12px;
  padding: 18px 22px;
}

.match {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.match-meta {
  padding: 9px 12px;
  background: #f1f4f8;
  color: var(--muted);
  font-size: 13px;
}

.empty,
.notice {
  margin: 18px 22px;
  padding: 12px 14px;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
}

.notice {
  background: #fff7ed;
  color: #9a3412;
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 16px;
  }

  .panel-head,
  .search-form {
    grid-template-columns: 1fr;
    display: grid;
  }

  .page {
    width: min(100vw - 20px, 1180px);
    margin: 14px auto;
  }
}
