/* WinUI 3 / Fluent Design System — Charger Launcher Release Portal */
:root {
  --bg-base: #202020;
  --bg-secondary: #1c1c1c;
  --bg-tertiary: #282828;
  --mica-1: rgba(255, 255, 255, 0.032);
  --mica-2: rgba(255, 255, 255, 0.018);

  --layer: rgba(255, 255, 255, 0.0538);
  --ctl: rgba(255, 255, 255, 0.0605);
  --ctl-hover: rgba(255, 255, 255, 0.0837);
  --ctl-pressed: rgba(255, 255, 255, 0.0326);
  --subtle-hover: rgba(255, 255, 255, 0.0605);

  --card-stroke: rgba(255, 255, 255, 0.0698);
  --ctl-stroke: rgba(255, 255, 255, 0.0698);
  --ctl-stroke-bottom: rgba(255, 255, 255, 0.093);
  --divider: rgba(255, 255, 255, 0.0837);
  --acrylic: rgba(32, 32, 32, 0.72);

  --text-1: #ffffff;
  --text-2: rgba(255, 255, 255, 0.786);
  --text-3: rgba(255, 255, 255, 0.5442);

  --accent: #60cdff;
  --accent-hover: #58c6f7;
  --accent-pressed: #50beef;
  --accent-fg: #000000;
  --accent-text: #99ebff;

  --danger: #ff99a4;
  --danger-bg: rgba(255, 153, 164, 0.12);

  --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, Menlo, monospace;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg-base: #f3f3f3;
  --bg-secondary: #eeeeee;
  --bg-tertiary: #f9f9f9;
  --mica-1: rgba(0, 0, 0, 0.010);
  --mica-2: rgba(0, 0, 0, 0.005);

  --layer: rgba(255, 255, 255, 0.70);
  --ctl: rgba(255, 255, 255, 0.70);
  --ctl-hover: rgba(249, 249, 249, 0.50);
  --ctl-pressed: rgba(249, 249, 249, 0.30);
  --subtle-hover: rgba(0, 0, 0, 0.0373);

  --card-stroke: rgba(0, 0, 0, 0.0578);
  --ctl-stroke: rgba(0, 0, 0, 0.0578);
  --ctl-stroke-bottom: rgba(0, 0, 0, 0.16);
  --divider: rgba(0, 0, 0, 0.0578);
  --acrylic: rgba(243, 243, 243, 0.74);

  --text-1: rgba(0, 0, 0, 0.8956);
  --text-2: rgba(0, 0, 0, 0.6063);
  --text-3: rgba(0, 0, 0, 0.4458);

  --accent: #005fb8;
  --accent-hover: #0057a8;
  --accent-pressed: #004e96;
  --accent-fg: #ffffff;
  --accent-text: #005fb8;

  --danger: #c42b1c;
  --danger-bg: rgba(196, 43, 28, 0.09);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  color: var(--text-1);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(60% 45% at 12% -8%, var(--mica-1), transparent 70%),
    radial-gradient(50% 40% at 88% 4%, var(--mica-2), transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: inherit; text-decoration: none; }
.accent-link { color: var(--accent-text); }
.accent-link:hover { text-decoration: underline; }
.muted { color: var(--text-3); }

.wrap {
  width: min(100% - 48px, 1000px);
  margin-inline: auto;
}

/* Sticky Acrylic Header */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 48px;
  background: var(--acrylic);
  backdrop-filter: blur(30px) saturate(125%);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
  border-bottom: 1px solid var(--divider);
}

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.brand__logo {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  flex-shrink: 0;
}

.nav__links {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13.5px;
  color: var(--text-2);
  transition: background-color 0.12s ease, color 0.12s ease;
}

.nav__link:hover {
  background: var(--subtle-hover);
  color: var(--text-1);
}

.nav__link.is-active {
  color: var(--text-1);
  font-weight: 500;
}

.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  transform: translateX(-50%);
  width: 16px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
}

.icon-btn {
  width: 32px;
  height: 32px;
  margin-left: 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.icon-btn:hover {
  background: var(--subtle-hover);
  color: var(--text-1);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Tag Badges (3px vertical pill) */
.tag-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: var(--text-2);
}

.tag-badge::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 99px;
  background: #4d6bfe;
  flex-shrink: 0;
}

.tag-badge--release { color: #798ffe; }
.tag-badge--release::before { background: #4d6bfe; }
:root[data-theme="light"] .tag-badge--release { color: #2b47c9; }

.tag-badge--beta { color: #ff7b0f; }
.tag-badge--beta::before { background: #ff7300; }
:root[data-theme="light"] .tag-badge--beta { color: #c85800; }

.tag-badge--preview { color: #75bc74; }
.tag-badge--preview::before { background: #108b0e; }
:root[data-theme="light"] .tag-badge--preview { color: #0e7a0d; }

/* Release Hero Sheet */
.sheet {
  padding: 40px 0 8px;
}

.sheet__head {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fluentIn 0.28s cubic-bezier(0.1, 0.9, 0.2, 1) both;
}

.kicker {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}

.sheet__version {
  margin: 8px 0 22px;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 8.5vw, 4.5rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  word-break: break-word;
  animation: fluentIn 0.28s cubic-bezier(0.1, 0.9, 0.2, 1) 30ms both;
}

/* 4-Column Specs Strip */
.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--layer);
  border: 1px solid var(--card-stroke);
  border-radius: 8px;
  overflow: hidden;
  animation: fluentIn 0.28s cubic-bezier(0.1, 0.9, 0.2, 1) 60ms both;
}

.spec {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 1px 0 0 var(--divider);
}

.spec:first-child { box-shadow: none; }

.spec__label {
  font-size: 12px;
  color: var(--text-3);
}

.spec__val {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

.spec__mono {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-2);
}

.spec__copy {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.spec__copy:hover {
  color: var(--accent-text);
}

/* Download CTA Row */
.actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  animation: fluentIn 0.28s cubic-bezier(0.1, 0.9, 0.2, 1) 90ms both;
}

.dl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 4px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: var(--ctl);
  color: var(--text-1);
  border: 1px solid var(--ctl-stroke);
  border-bottom-color: var(--ctl-stroke-bottom);
  transition: background-color 0.12s ease, transform 0.08s ease;
}

.dl:hover { background: var(--ctl-hover); }
.dl:active { background: var(--ctl-pressed); transform: scale(0.99); }
.dl:disabled { opacity: 0.55; cursor: not-allowed; }

.dl--primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
}

.dl--primary:hover { background: var(--accent-hover); }
.dl--primary:active { background: var(--accent-pressed); }

.dl__ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.dl__meta {
  font-size: 12px;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

/* Inline Turnstile Verification Slot */
.dl-verify {
  margin-top: 12px;
  animation: fluentIn 0.22s cubic-bezier(0.1, 0.9, 0.2, 1) both;
}

.dl-verify__inner {
  background: var(--layer);
  border: 1px solid var(--card-stroke);
  border-radius: 8px;
  padding: 16px 18px;
}

.dl-verify__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dl-verify__title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-1);
}

.dl-verify__msg {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
}

.dl-verify__msg.is-err { color: var(--danger); }

/* Sections & Cards */
.sec {
  margin-top: 28px;
}

.sec__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sec__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sec__note {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.card {
  background: var(--layer);
  border: 1px solid var(--card-stroke);
  border-radius: 8px;
  padding: 24px;
}

.card--table {
  padding: 14px 8px 10px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card__head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

/* Changelog Prose */
.changelog {
  max-width: 72ch;
  color: var(--text-2);
}

.changelog p { margin: 0 0 10px; }
.changelog p:last-child { margin-bottom: 0; }
.changelog h3 {
  margin: 14px 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.changelog h3:first-child { margin-top: 0; }
.changelog ul {
  margin: 0 0 10px;
  padding-left: 18px;
}
.changelog li { margin: 4px 0; }

/* WinUI ListView Ledger Table */
.ledger {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 2px;
}

.ledger th {
  padding: 6px 14px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  text-align: left;
  border-bottom: 1px solid var(--divider);
}

.ledger td {
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.ledger tbody tr {
  transition: background-color 0.1s ease;
}

.ledger tbody tr td:first-child {
  position: relative;
  border-radius: 4px 0 0 4px;
  color: var(--text-1);
}

.ledger tbody tr td:last-child {
  border-radius: 0 4px 4px 0;
  text-align: right;
  white-space: nowrap;
}

.ledger tbody tr:hover td {
  background: var(--subtle-hover);
}

.ledger tbody tr.is-current td {
  background: var(--subtle-hover);
}

.ledger tbody tr.is-current td:first-child::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  border-radius: 99px;
  background: var(--accent);
}

/* About & Screenshots */
.about-text {
  margin: 0;
  color: var(--text-2);
  max-width: 78ch;
  line-height: 1.65;
}

.about-meta {
  margin: 12px 0 0;
  font-size: 13px;
}

.shots {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.shot {
  margin: 0;
  background: var(--layer);
  border: 1px solid var(--card-stroke);
  border-radius: 8px;
  overflow: hidden;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.shot figcaption {
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--text-3);
  border-top: 1px solid var(--divider);
}

/* Footer */
.footer {
  margin-top: 32px;
  border-top: 1px solid var(--divider);
  padding: 18px 0 40px;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-3);
}

.footer__links {
  display: inline-flex;
  gap: 16px;
}

.footer__links a:hover { color: var(--text-1); }

/* Admin Styles */
.admin-wrap { padding-top: 28px; }

.auth-shell {
  min-height: 62vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-dialog {
  width: min(100%, 400px);
  background: var(--bg-tertiary);
  border: 1px solid var(--card-stroke);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.36);
}

.auth-dialog__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-dialog__head h1 {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 600;
}

.auth-dialog__head p {
  margin: 0;
  font-size: 12.5px;
}

.admin-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.admin-top__acts {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 8px;
}

.tab {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 13.5px;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
}

.tab:hover { background: var(--subtle-hover); color: var(--text-1); }
.tab.is-active { background: var(--subtle-hover); color: var(--text-1); font-weight: 500; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 18px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field--full { grid-column: 1 / -1; }
.field > span { font-size: 12.5px; color: var(--text-2); font-weight: 500; }

.field input[type="text"],
.field input[type="password"],
.field input[type="url"],
.field input[type="date"],
.field input[type="file"],
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--text-1);
  background: var(--ctl);
  border: 1px solid var(--ctl-stroke);
  border-bottom-color: var(--ctl-stroke-bottom);
  border-radius: 4px;
  padding: 7px 10px;
  outline: none;
}

.field select option {
  background: var(--bg-tertiary);
  color: var(--text-1);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-bottom: 2px solid var(--accent);
}

.field--check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-top: 22px;
}

.field--full.field--check { padding-top: 2px; }
.field--check input { width: 16px; height: 16px; accent-color: var(--accent); }
.field--check span { font-size: 13.5px; color: var(--text-1); font-weight: 400; }

.form-actions { display: flex; gap: 8px; align-items: center; }
.form-err { margin: 0; font-size: 12.5px; color: var(--danger); }

.btn-ctl, .btn-ghost, .btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 4px;
  font-family: var(--font);
  font-size: 12.5px;
  cursor: pointer;
}

.btn-ctl {
  background: var(--ctl);
  color: var(--text-1);
  border: 1px solid var(--ctl-stroke);
  border-bottom-color: var(--ctl-stroke-bottom);
}
.btn-ctl:hover { background: var(--ctl-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 0;
}
.btn-ghost:hover { background: var(--subtle-hover); color: var(--text-1); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid transparent;
}
.btn-danger:hover { filter: brightness(1.1); }

.act-group {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.guide-box {
  background: var(--subtle-hover);
  border: 1px solid var(--divider);
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-2);
}

.guide-box ol { margin: 8px 0 0; padding-left: 18px; }
.guide-box li { margin: 4px 0; }
.guide-box code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--ctl);
  padding: 1px 5px;
  border-radius: 3px;
}

.badge-pill {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--ctl);
  color: var(--text-3);
}

.badge-pill.is-on {
  background: rgba(16, 139, 14, 0.2);
  color: #75bc74;
}

.hr {
  border: 0;
  border-top: 1px solid var(--divider);
  margin: 4px 0;
}

.progress {
  height: 6px;
  border-radius: 99px;
  background: var(--ctl);
  overflow: hidden;
  margin-bottom: 6px;
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s linear;
}

.toast {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--layer);
  border: 1px solid var(--card-stroke);
  border-left: 3px solid var(--accent);
  font-size: 13px;
}

.toast.is-err { border-left-color: var(--danger); color: var(--danger); }

.shots-admin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.shot-admin-card {
  background: var(--layer);
  border: 1px solid var(--card-stroke);
  border-radius: 8px;
  overflow: hidden;
}

.shot-admin-card img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.shot-admin-card__foot {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--divider);
  font-size: 12.5px;
}

/* Animations & View Transitions */
@keyframes fluentIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  animation: theme-reveal 0.45s cubic-bezier(0.1, 0.9, 0.2, 1) both;
}

@keyframes theme-reveal {
  from { clip-path: circle(0px at var(--theme-x, 90%) var(--theme-y, 24px)); }
  to { clip-path: circle(150vmax at var(--theme-x, 90%) var(--theme-y, 24px)); }
}

.theme-switching * { transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .sheet__head, .sheet__version, .specs, .actions, .dl-verify { animation: none; }
  ::view-transition-new(root) { animation: none; }
}

/* Mobile Breakpoint */
@media (max-width: 560px) {
  .wrap { width: min(100% - 32px, 1000px); }
  .nav { height: 44px; }
  .brand__name { display: none; }
  .nav__link { padding: 5px 8px; font-size: 13px; }
  .sheet { padding-top: 26px; }
  .specs { grid-template-columns: repeat(2, 1fr); }
  .spec { box-shadow: none; border-bottom: 1px solid var(--divider); border-right: 1px solid var(--divider); }
  .spec:nth-child(2n) { border-right: 0; }
  .spec:nth-last-child(-n+2) { border-bottom: 0; }
  .actions { flex-direction: column; }
  .actions .dl { width: 100%; justify-content: center; }
  .ledger .col-date, .ledger .col-dl { display: none; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .field--check { padding-top: 4px; }
  .admin-top { flex-direction: column; align-items: flex-start; }
}
