:root {
  --ink: #0a0a0a;
  --paper: #f7f7f5;
  --white: #fff;
  --soft: #ececea;
  --muted: #666;
  --line: #d3d3cf;
  --danger: #b42318;
  --radius: 18px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.09);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background:
    linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; }
[hidden], .hidden { display: none !important; }

.topbar {
  height: 72px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 245, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--ink);
  border-radius: 50%;
  color: var(--white);
  font-size: 12px;
  letter-spacing: 0;
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.link-button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.download-main {
  min-height: calc(100vh - 72px);
  padding: 48px 20px;
  display: grid;
  place-items: center;
}

.download-card {
  width: min(680px, 100%);
  padding: clamp(30px, 6vw, 64px);
  border: 1px solid var(--ink);
  border-radius: 28px;
  background: var(--white);
  box-shadow: var(--shadow);
  text-align: center;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.resource-code {
  display: inline-flex;
  padding: 8px 13px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

h1 {
  margin: 22px 0 14px;
  font-size: clamp(30px, 6vw, 54px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.notice {
  max-width: 520px;
  margin: 30px auto 26px;
  padding: 20px;
  border: 1px solid var(--ink);
  background: var(--soft);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.8;
}

.notice span {
  display: block;
}

.muted { color: var(--muted); line-height: 1.7; }
.small { font-size: 12px; }

.btn {
  min-height: 50px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--ink); color: var(--white); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.compact { min-height: 36px; padding: 0 14px; font-size: 12px; }
.button-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.status-message { min-height: 24px; margin: 16px 0 0; color: var(--muted); }
.status-message.error { color: var(--danger); }

.dashboard {
  width: min(1180px, calc(100% - 32px));
  margin: 38px auto 70px;
}

.dashboard-heading {
  margin-bottom: 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.dashboard-heading h1 { margin: 4px 0 0; font-size: clamp(34px, 6vw, 64px); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(92px, 1fr)); gap: 10px; }
.stat { padding: 16px; border: 1px solid var(--ink); background: var(--white); }
.stat strong { display: block; font-size: 26px; }
.stat span { color: var(--muted); font-size: 12px; }

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.tab {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  cursor: pointer;
  white-space: nowrap;
}

.tab.active { border-color: var(--ink); background: var(--ink); color: var(--white); }
.panel { padding: 24px; border: 1px solid var(--ink); background: var(--white); }
.panel + .panel { margin-top: 18px; }
.panel-title { margin: 0 0 18px; font-size: 20px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field { display: grid; gap: 7px; }
.field.wide { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 12px; font-weight: 700; }

.field input, .field select, .field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  outline: none;
}

.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.field textarea { min-height: 84px; resize: vertical; }
.form-actions { margin-top: 16px; display: flex; align-items: center; gap: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.badge { display: inline-flex; padding: 4px 8px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); font-size: 11px; }
.empty { padding: 34px 12px; color: var(--muted); text-align: center; }

@media (max-width: 720px) {
  .topbar { height: 64px; padding: 0 16px; }
  .brand-text { display: none; }
  .download-main { min-height: calc(100vh - 64px); padding: 22px 14px; }
  .download-card { padding: 34px 22px; border-radius: 22px; }
  .notice { font-size: 14px; }
  .dashboard { width: min(100% - 24px, 1180px); margin-top: 24px; }
  .dashboard-heading { align-items: stretch; flex-direction: column; }
  .stats { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .panel { padding: 16px; }
  th, td { white-space: nowrap; }
}
