:root {
  --bg: #07080a;
  --bg-2: #0b0d11;
  --panel: #101218;
  --panel-2: #141821;
  --line: #242936;
  --line-soft: #1a1f29;
  --text: #e9e7e1;
  --muted: #8d94a3;
  --dim: #5f6675;
  --amber: #ffb454;
  --amber-2: #ff8a3d;
  --cyan: #6de3ff;
  --red: #ff5c5c;
  --green: #7ee787;
  --shadow: 0 20px 60px rgba(0,0,0,.42);
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  --sans: "Inter", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(255,180,84,.10), transparent 62%),
    radial-gradient(900px 600px at 0% 20%, rgba(109,227,255,.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.032) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 78%);
  z-index: 0;
}
a { color: var(--amber); text-decoration: none; }
a:hover { color: #ffd08a; }
button, input, select { font: inherit; }
button { cursor: pointer; }
::selection { background: rgba(255,180,84,.28); color: #fff; }

.wrap { width: min(1240px, calc(100% - 40px)); margin: 0 auto; position: relative; z-index: 1; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.amber { color: var(--amber); }
.cyan { color: var(--cyan); }
.red { color: var(--red); }
.green { color: var(--green); }
.nowrap { white-space: nowrap; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,8,10,.82);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(16px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 13px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; position: relative; flex: 0 0 auto;
  border: 1px solid rgba(255,180,84,.55);
  transform: rotate(45deg);
  background: linear-gradient(135deg, rgba(255,180,84,.22), transparent 65%);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 7px;
  border: 1px solid rgba(109,227,255,.65);
}
.brand-text b { display: block; letter-spacing: .18em; font-size: 14px; line-height: 1.2; }
.brand-text span { display: block; font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: .16em; }
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a {
  padding: 8px 12px; color: var(--muted); border: 1px solid transparent;
  font-size: 13px; letter-spacing: .04em;
}
.nav a:hover { color: var(--text); border-color: var(--line); background: rgba(255,255,255,.025); }
.nav a[aria-current="page"] { color: var(--amber); border-color: rgba(255,180,84,.32); background: rgba(255,180,84,.06); }
.header-meta { font-family: var(--mono); font-size: 10px; color: var(--dim); text-align: right; line-height: 1.5; }

/* hero */
.hero { padding: 72px 0 44px; position: relative; }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .22em; color: var(--amber); text-transform: uppercase; }
.hero h1 {
  margin: 14px 0 12px; font-size: clamp(38px, 7vw, 82px); line-height: .98;
  letter-spacing: -.045em; font-weight: 650;
}
.hero h1 span { color: var(--amber); }
.hero p { max-width: 720px; color: var(--muted); font-size: 16px; margin: 0; }
.hero-rule { height: 1px; background: linear-gradient(90deg, var(--amber), rgba(255,180,84,.12), transparent); margin-top: 34px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 34px; align-items: end; }
.hero-side { border-left: 1px solid var(--line); padding-left: 24px; }
.hero-side .label { font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: .18em; }
.hero-side .value { font-family: var(--mono); font-size: 32px; color: var(--cyan); line-height: 1.1; }
.hero-side .sub { color: var(--muted); font-size: 12px; }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.stat {
  background: linear-gradient(180deg, rgba(255,255,255,.026), transparent 80%), var(--panel);
  border: 1px solid var(--line); padding: 18px 18px 16px; position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; width: 38px; height: 2px; background: var(--amber);
}
.stat .k { color: var(--dim); font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.stat .v { font-family: var(--mono); font-size: clamp(26px, 3.2vw, 40px); line-height: 1.2; color: var(--text); }
.stat .s { color: var(--muted); font-size: 12px; }
.stat.cyan-stat::before { background: var(--cyan); }
.stat.red-stat::before { background: var(--red); }
.stat.green-stat::before { background: var(--green); }

/* sections */
.section { padding: 42px 0; border-top: 1px solid var(--line-soft); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.section-head .hint { color: var(--dim); font-family: var(--mono); font-size: 11px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); padding: 20px;
  box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 4px; font-size: 15px; }
.panel .panel-sub { color: var(--dim); font-family: var(--mono); font-size: 10px; letter-spacing: .12em; margin-bottom: 14px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 9px 14px; font-size: 13px; line-height: 1; transition: .15s ease;
}
.btn:hover { border-color: rgba(255,180,84,.5); color: var(--amber); background: rgba(255,180,84,.06); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #151007; font-weight: 650; }
.btn.primary:hover { background: #ffc978; color: #151007; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 11px; }

/* latest backup */
.latest {
  border: 1px solid rgba(255,180,84,.35);
  background:
    linear-gradient(135deg, rgba(255,180,84,.10), transparent 42%),
    var(--panel);
}
.latest-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.latest h3 { font-size: 24px; margin: 0; }
.latest .version { font-family: var(--mono); font-size: 42px; color: var(--amber); line-height: 1; }
.backup-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.hash-line { font-family: var(--mono); font-size: 10px; color: var(--dim); word-break: break-all; }

/* bars */
.bar-row { display: grid; grid-template-columns: 112px minmax(0,1fr) 44px; gap: 10px; align-items: center; margin: 7px 0; }
.bar-row .name { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: #0a0c10; border: 1px solid var(--line-soft); overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--amber-2), var(--amber)); width: 0; }
.bar-row .num { font-family: var(--mono); font-size: 11px; color: var(--text); text-align: right; }

/* table */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search {
  flex: 1 1 260px; min-width: 200px; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); padding: 10px 12px; outline: none;
}
.search:focus { border-color: rgba(255,180,84,.55); }
.select { background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 9px 10px; }
.count-tag { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-left: auto; }
.table-wrap { border: 1px solid var(--line); overflow: auto; background: var(--panel); }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); }
th {
  position: sticky; top: 0; background: #0d1015; z-index: 1;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--dim);
  font-weight: 500; text-transform: uppercase;
}
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: rgba(255,180,84,.055); }
tbody tr.selected { background: rgba(255,180,84,.10); }
td.name { color: var(--text); font-weight: 550; }
td .sub { display: block; color: var(--dim); font-family: var(--mono); font-size: 10px; }
td.num { font-family: var(--mono); font-size: 12px; }
.badge {
  display: inline-block; border: 1px solid var(--line); padding: 1px 6px;
  font-family: var(--mono); font-size: 10px; color: var(--muted); margin: 1px 3px 1px 0;
}
.badge.amber { border-color: rgba(255,180,84,.35); color: var(--amber); }
.badge.cyan { border-color: rgba(109,227,255,.35); color: var(--cyan); }

/* layout aircraft */
.aircraft-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr); gap: 14px; align-items: start; }
.detail { position: sticky; top: 86px; max-height: calc(100vh - 104px); overflow: auto; }
.detail-empty { color: var(--dim); padding: 40px 10px; text-align: center; }
.detail h2 { margin: 0 0 2px; font-size: 21px; line-height: 1.3; }
.detail .path { font-family: var(--mono); font-size: 10px; color: var(--dim); word-break: break-all; }
.spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); margin: 14px 0; }
.spec-grid div { background: var(--panel); padding: 9px 10px; }
.spec-grid .k { font-family: var(--mono); font-size: 9px; color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }
.spec-grid .v { font-family: var(--mono); font-size: 14px; color: var(--text); }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.note { border-left: 2px solid var(--amber); padding: 8px 12px; background: rgba(255,180,84,.05); color: var(--muted); font-size: 12px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12px; }
.kv span:first-child { color: var(--dim); }
.kv span:last-child { font-family: var(--mono); text-align: right; word-break: break-all; }
.detail-section { margin-top: 18px; }
.detail-section h3 { margin: 0 0 8px; color: var(--amber); font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.detail-intro { margin: 0 0 9px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.dim-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.dim-grid div { background: var(--panel); padding: 8px 10px; }
.dim-grid .k { font-family: var(--mono); font-size: 9px; color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }
.dim-grid .v { font-family: var(--mono); font-size: 14px; color: var(--text); }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li { border-bottom: 1px dashed var(--line-soft); }
.history-item { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.history-item:hover .hname { color: var(--amber); }
.hname { font-size: 12px; line-height: 1.4; }
.hmeta { flex: none; color: var(--dim); font-family: var(--mono); font-size: 9px; white-space: nowrap; }

/* charts */
.chart { width: 100%; height: auto; display: block; background: #0a0c10; border: 1px solid var(--line-soft); }
.chart text { fill: var(--muted); font-family: var(--mono); font-size: 9px; }
.chart .axis { stroke: #2a303c; stroke-width: 1; }
.chart .grid-line { stroke: #1b202a; stroke-width: 1; }
.chart .dot { opacity: .75; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.legend span { font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 4px; }

/* backup list */
.backup-list { display: grid; gap: 12px; }
.backup-card { display: grid; grid-template-columns: 110px minmax(0,1fr) auto; gap: 18px; align-items: center; }
.backup-card .ver { font-family: var(--mono); font-size: 26px; color: var(--amber); line-height: 1; }
.backup-card .ver small { display: block; color: var(--dim); font-size: 10px; letter-spacing: .08em; }
.backup-card .meta { color: var(--muted); font-size: 12px; }
.backup-card .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.backup-card.latest-card { border-color: rgba(255,180,84,.4); background: linear-gradient(135deg, rgba(255,180,84,.08), transparent 45%), var(--panel); }

/* footer */
.site-footer { border-top: 1px solid var(--line-soft); padding: 28px 0 40px; margin-top: 30px; color: var(--dim); font-family: var(--mono); font-size: 10px; display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }

/* misc */
.error { border: 1px solid rgba(255,92,92,.35); background: rgba(255,92,92,.06); color: #ffb1b1; padding: 12px 14px; }
.loading { color: var(--dim); font-family: var(--mono); font-size: 12px; padding: 24px 0; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12px; }
.list li span:last-child { font-family: var(--mono); color: var(--muted); }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .aircraft-layout { grid-template-columns: 1fr; }
  .detail { position: static; max-height: none; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .wrap { width: min(100% - 24px, 1240px); }
  .header-inner { min-height: auto; padding: 12px 0; align-items: flex-start; flex-direction: column; }
  .header-meta { display: none; }
  .nav a { padding: 7px 8px; font-size: 12px; }
  .hero { padding: 46px 0 30px; }
  .stat-grid, .grid-2, .grid-3, .two-col { grid-template-columns: 1fr; }
  .backup-card { grid-template-columns: 1fr; gap: 8px; }
  .backup-card .actions { justify-content: flex-start; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 30px 0; }
}
