:root {
  --ink: #202124;
  --ink-soft: #3f4247;
  --muted: #777b82;
  --faint: #a8abb0;
  --line: #e7e8e6;
  --line-strong: #d9dbd8;
  --canvas: #f7f7f5;
  --surface: #ffffff;
  --surface-soft: #fafaf9;
  --green: #346538;
  --green-soft: #edf3ec;
  --amber: #956400;
  --amber-soft: #fbf3db;
  --red: #9f2f2d;
  --red-soft: #fdebec;
  font-family: "SF Pro Display", "Helvetica Neue", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
[hidden] { display: none !important; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
}
.muted { color: var(--muted); }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
}
.login-card {
  width: min(400px, 100%);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 50px rgba(20, 22, 20, .04);
}
.login-card .mark,
.brand-mark {
  display: grid;
  place-items: center;
  color: white;
  background: #202124;
}
.login-card .mark { width: 42px; height: 42px; margin-bottom: 30px; border-radius: 8px; }
.login-card .mark svg { width: 22px; height: 22px; }
.login-card h1 { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -.035em; }
.login-card > p.muted { margin: 10px 0 28px; font-size: 14px; line-height: 1.7; }

label { display: grid; gap: 8px; margin-bottom: 17px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus { border-color: #888b8f; box-shadow: 0 0 0 3px rgba(32, 33, 36, .06); }
.form-error { min-height: 18px; margin: -3px 0 12px; color: var(--red); font-size: 12px; }

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  transition: background .16s ease, border-color .16s ease, transform .12s ease;
}
.button:hover { border-color: #c7c9c6; background: var(--surface-soft); }
.button:active { transform: scale(.98); }
.button.primary { border-color: #202124; background: #202124; color: white; }
.button.primary:hover { border-color: #36383b; background: #36383b; }
.button.primary svg { width: 16px; height: 16px; }
.button.wide { width: 100%; }
.button.danger { border-color: #edcfce; color: var(--red); }
.button.danger:hover { background: var(--red-soft); }
.button.small { min-height: 32px; padding: 0 11px; border-radius: 5px; font-size: 12px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 7px; }
.brand-mark svg { width: 17px; height: 17px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 13px; font-weight: 650; }
.brand small { margin-top: 1px; color: var(--faint); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.account { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; }
.text-button, .icon-button { border: 0; background: transparent; color: inherit; }
.text-button { padding: 6px 0; }
.text-button:hover { color: var(--ink); }

main { width: min(1380px, 100%); margin: 0 auto; padding: 48px clamp(20px, 4vw, 56px) 72px; }
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}
.hero h1 { margin: 0; font-size: clamp(32px, 4vw, 46px); font-weight: 620; letter-spacing: -.045em; line-height: 1.08; }
.hero p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.summary article {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 21px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.summary span { color: var(--muted); font-size: 12px; }
.summary strong { font-size: 30px; font-weight: 570; letter-spacing: -.04em; }

.workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.toolbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 2px; }
.tabs button {
  padding: 8px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.tabs button:hover { color: var(--ink); background: var(--surface-soft); }
.tabs button.active { background: #f0f0ee; color: var(--ink); font-weight: 650; }
.search {
  width: min(280px, 40vw);
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--faint);
  background: var(--surface-soft);
}
.search span { display: grid; }
.search svg { width: 15px; height: 15px; }
.search input { height: 36px; padding: 0; border: 0; box-shadow: none; background: transparent; font-size: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; }
th {
  padding: 12px 18px;
  color: var(--faint);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 650;
  text-align: left;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
th:nth-child(1) { width: 35%; }
th:nth-child(2) { width: 10%; }
th:nth-child(3) { width: 10%; }
th:nth-child(4) { width: 15%; }
th:nth-child(5) { width: 30%; }
td { padding: 17px 18px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; vertical-align: middle; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fcfcfb; }
.site-title { max-width: 400px; }
.site-title strong { display: block; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.site-title code { display: block; margin-top: 5px; color: var(--faint); font: 10px "SF Mono", "JetBrains Mono", monospace; letter-spacing: .03em; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 9999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.disabled { color: var(--amber); background: var(--amber-soft); }
.badge.trashed { color: var(--red); background: var(--red-soft); }
.row-actions { min-width: 280px; display: flex; justify-content: flex-end; gap: 6px; }
.actions-head { text-align: right; }

.empty { min-height: 320px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.empty-icon svg { width: 20px; height: 20px; }
.empty h2 { margin: 14px 0 5px; color: var(--ink); font-size: 16px; font-weight: 620; }
.empty p { margin: 0; font-size: 12px; }

.detail-dialog {
  width: min(880px, calc(100vw - 30px));
  max-height: min(820px, calc(100vh - 30px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(20, 22, 20, .09);
}
.detail-dialog::backdrop { background: rgba(25, 27, 25, .42); backdrop-filter: blur(2px); }
.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.dialog-head h2 { margin: 0; font-size: 21px; font-weight: 620; letter-spacing: -.025em; }
.icon-button { width: 34px; height: 34px; border-radius: 6px; color: var(--muted); font-size: 24px; }
.icon-button:hover { background: var(--surface-soft); color: var(--ink); }
.detail-content { padding: 24px 26px 30px; }
.url-box { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.url-box code { flex: 1; overflow: hidden; color: var(--ink-soft); font: 11px "SF Mono", "JetBrains Mono", monospace; text-overflow: ellipsis; white-space: nowrap; }
.section-title { margin: 26px 0 11px; font-size: 12px; font-weight: 650; }
.version-list { display: grid; gap: 9px; }
.version { padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.version.current { border-color: #d7e1d5; background: #fdfefd; }
.version-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.version-title { display: flex; align-items: center; gap: 8px; }
.version-title strong { font-size: 16px; font-weight: 650; }
.current-label { padding: 3px 7px; border-radius: 9999px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 700; letter-spacing: .03em; }
.version-meta { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.version-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.warnings { margin-top: 11px; padding: 9px 11px; border-radius: 6px; background: var(--amber-soft); color: #765513; font-size: 10px; line-height: 1.75; }

.upload-overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 11px; color: white; background: rgba(27, 29, 27, .82); }
.upload-overlay span { color: rgba(255, 255, 255, .62); font-size: 11px; }
.loader { width: 32px; height: 32px; margin-bottom: 7px; border: 2px solid rgba(255, 255, 255, .2); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: min(380px, calc(100vw - 44px)); padding: 12px 15px; border: 1px solid #36383b; border-radius: 7px; background: #202124; color: white; box-shadow: 0 10px 30px rgba(20, 22, 20, .09); font-size: 12px; }
.toast.error { border-color: #b94743; }

@media (prefers-reduced-motion: no-preference) {
  .hero, .summary, .workspace { animation: enter .5s cubic-bezier(.16, 1, .3, 1) both; }
  .summary { animation-delay: .05s; }
  .workspace { animation-delay: .1s; }
  @keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 850px) {
  .summary { grid-template-columns: repeat(2, 1fr); }
  .hero { align-items: flex-start; flex-direction: column; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .row-actions { min-width: 240px; }
}

@media (max-width: 560px) {
  .login-card { padding: 32px 24px; }
  .topbar { padding: 0 16px; }
  .brand small, .account span { display: none; }
  main { padding: 34px 16px 56px; }
  .hero > div:last-child, .hero .button { width: 100%; }
  .tabs { overflow-x: auto; }
  .summary article { min-height: 96px; padding: 17px; }
  .table-wrap { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  table { min-width: 0; table-layout: auto; }
  thead { display: none; }
  tbody tr { padding: 18px; border-top: 1px solid var(--line); }
  td { padding: 4px 0; border: 0; }
  td.site-title { max-width: none; margin-bottom: 11px; }
  td:nth-child(2), td:nth-child(3), td:nth-child(4) { display: inline-flex; align-items: center; margin-right: 14px; }
  td:nth-child(3)::before { content: "版本"; margin-right: 6px; color: var(--faint); font-size: 10px; }
  td:nth-child(4) { margin-top: 8px; color: var(--muted); }
  td:last-child { margin-top: 13px; }
  .row-actions { min-width: 0; flex-wrap: wrap; justify-content: flex-start; }
  .dialog-head, .detail-content { padding-left: 18px; padding-right: 18px; }
  .version-top { flex-direction: column; }
  .version-actions { justify-content: flex-start; }
}
