/* APP仓库(H19) — storefront styles. No external fonts or assets. */

:root {
  --bg: #070b12;
  --bg-soft: #0b1220;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(255, 255, 255, 0.075);
  --panel-solid: #111a2b;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef3ff;
  --muted: #97a5bd;
  --dim: #6b7a93;
  --blue: #5b8cff;
  --blue-deep: #2563eb;
  --cyan: #57d4ff;
  --teal: #2dd4a7;
  --amber: #ffb547;
  --red: #ff6b6b;
  --radius-lg: 24px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

::selection {
  background: rgba(91, 140, 255, 0.35);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ */
/* Background                                                          */
/* ------------------------------------------------------------------ */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 12% -8%, rgba(44, 105, 255, 0.24), transparent 62%),
    radial-gradient(900px 620px at 92% 4%, rgba(87, 212, 255, 0.12), transparent 58%),
    radial-gradient(1000px 800px at 60% 110%, rgba(124, 92, 255, 0.14), transparent 65%),
    linear-gradient(180deg, #070b12 0%, #080e18 45%, #060a11 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite alternate;
}

.orb-a {
  width: 420px;
  height: 420px;
  left: -140px;
  top: 160px;
  background: rgba(58, 121, 255, 0.28);
}

.orb-b {
  width: 360px;
  height: 360px;
  right: -80px;
  top: 420px;
  background: rgba(87, 212, 255, 0.14);
  animation-delay: -6s;
}

.orb-c {
  width: 460px;
  height: 460px;
  left: 42%;
  bottom: -260px;
  background: rgba(124, 92, 255, 0.18);
  animation-delay: -11s;
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 72%);
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(30px, -40px, 0) scale(1.08);
  }
}

/* ------------------------------------------------------------------ */
/* Topbar                                                              */
/* ------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 66px;
  padding: 0 clamp(18px, 4vw, 48px);
  border-bottom: 1px solid transparent;
  background: rgba(7, 11, 18, 0.55);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 18%, var(--line) 82%, transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  border-radius: 12px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  box-shadow: 0 8px 24px rgba(44, 105, 255, 0.35);
}

.brand-word {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(87, 212, 255, 0.35);
  border-radius: 7px;
  background: rgba(87, 212, 255, 0.1);
  color: #a9e7ff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */

.page {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(30px, 5vw, 64px) 0 40px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: end;
  padding-bottom: clamp(28px, 4vw, 46px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #9cc4ff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.pulse-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(45, 212, 167, 0.12);
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(45, 212, 167, 0.55);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 1;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5.2vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 760;
}

.grad {
  background: linear-gradient(100deg, #ffffff 6%, #b9d4ff 42%, #7de8ff 78%, #9f8bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 620px;
  margin: 20px 0 28px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.75;
}

.search-shell {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 560px;
  height: 54px;
  padding: 0 14px 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.search-shell:focus-within {
  border-color: rgba(91, 140, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.1);
}

.search-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-shell input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}

.search-shell input::placeholder {
  color: var(--dim);
}

.search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 84px;
  align-self: end;
  gap: 10px;
}

.stat {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 140, 255, 0.18), transparent 68%);
}

.stat-label {
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.stat-value {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat-value.is-warn {
  color: var(--amber);
}

.stat-hint {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 11px;
  text-align: right;
}

.stat.skeleton {
  animation: shimmer 1.6s linear infinite;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 20%, rgba(255, 255, 255, 0.08) 40%, rgba(255, 255, 255, 0.04) 60%);
  background-size: 220% 100%;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

/* ------------------------------------------------------------------ */
/* Toolbar                                                             */
/* ------------------------------------------------------------------ */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 14px;
  border-top: 1px solid var(--line);
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

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

.tab.is-active {
  background: linear-gradient(180deg, rgba(91, 140, 255, 0.28), rgba(91, 140, 255, 0.15));
  color: #eaf1ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 6px 18px rgba(37, 99, 235, 0.18);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

.tab.is-active .tab-count {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrap select {
  height: 36px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12.5px;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--dim);
  border-bottom: 1.5px solid var(--dim);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.chips {
  display: flex;
  gap: 8px;
  padding-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12.5px;
  transition: all 0.18s;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.chip.is-active {
  border-color: rgba(87, 212, 255, 0.36);
  background: rgba(87, 212, 255, 0.11);
  color: #c8f2ff;
}

.chip-count {
  margin-left: 5px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
}

/* ------------------------------------------------------------------ */
/* Cards                                                               */
/* ------------------------------------------------------------------ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 238px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(420px 200px at 100% 0%, rgba(91, 140, 255, 0.1), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.022) 46%, rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 34px rgba(0, 0, 0, 0.16);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  cursor: pointer;
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.18), transparent 32%, transparent 70%, rgba(87, 212, 255, 0.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: rgba(91, 140, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 22px 50px rgba(0, 0, 0, 0.28);
}

.app-card:focus-visible {
  outline: 2px solid rgba(87, 212, 255, 0.65);
  outline-offset: 3px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-width: 0;
}

.app-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 15px;
  background: linear-gradient(150deg, #1a2742, #0f1727);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-icon .icon-fallback {
  display: none;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #dbe9ff;
}

.app-icon.is-fallback img {
  display: none;
}

.app-icon.is-fallback .icon-fallback {
  display: block;
}

.card-title {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.card-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 680;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-id {
  margin: 4px 0 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status-pill.is-installed {
  border-color: rgba(45, 212, 167, 0.28);
  background: rgba(45, 212, 167, 0.1);
  color: #8df3d5;
}

.status-pill.is-update {
  border-color: rgba(255, 181, 71, 0.34);
  background: rgba(255, 181, 71, 0.11);
  color: #ffd28a;
}

.card-summary {
  display: -webkit-box;
  margin: 16px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.card-actions .btn {
  flex: 1;
}

.card-actions .btn-icon {
  flex: 0 0 auto;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.16s, background 0.16s, border-color 0.16s, opacity 0.16s;
  user-select: none;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.11);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-primary {
  border-color: rgba(120, 164, 255, 0.4);
  background: linear-gradient(180deg, #5b8cff, #3b6fe8);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #6b99ff, #4a7cf2);
}

.btn-soft {
  border-color: rgba(87, 212, 255, 0.24);
  background: rgba(87, 212, 255, 0.1);
  color: #bdefff;
}

.btn-soft:hover {
  background: rgba(87, 212, 255, 0.16);
}

.btn-danger {
  border-color: rgba(255, 107, 107, 0.24);
  background: rgba(255, 107, 107, 0.09);
  color: #ffb3b3;
}

.btn-danger:hover {
  background: rgba(255, 107, 107, 0.16);
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.btn-small {
  height: 31px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 11.5px;
}

.btn-icon {
  width: 38px;
  padding: 0;
}

.btn-icon.btn-small {
  width: 31px;
}

.btn.is-busy {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ */
/* Empty & footnote                                                    */
/* ------------------------------------------------------------------ */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 50px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.empty-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(91, 140, 255, 0.18), rgba(87, 212, 255, 0.08));
  color: #dbeaff;
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.empty h2 {
  margin: 22px 0 6px;
  font-size: 21px;
}

.empty p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.empty-cmd {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 22px;
}

.empty-cmd code,
.code-line {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.28);
  color: #cfe0ff;
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  overflow-x: auto;
  max-width: 100%;
}

.footnote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11.5px;
  flex-wrap: wrap;
}

.footnote-left,
.footnote-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
}

.status-dot.is-online {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(45, 212, 167, 0.1);
}

.status-dot.is-offline {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
}

.link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.18);
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: var(--text);
}

.sep {
  opacity: 0.5;
}

/* ------------------------------------------------------------------ */
/* Modal                                                               */
/* ------------------------------------------------------------------ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fade-in 0.18s ease;
}

.modal {
  position: relative;
  width: min(880px, 100%);
  max-height: min(88vh, 980px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background:
    radial-gradient(700px 300px at 15% 0%, rgba(91, 140, 255, 0.12), transparent 60%),
    linear-gradient(180deg, #0e1626 0%, #0a111d 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: modal-in 0.24s cubic-bezier(0.22, 0.8, 0.3, 1);
  scrollbar-width: thin;
}

.modal.modal-small {
  width: min(480px, 100%);
  padding: 24px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 11, 18, 0.6);
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 28px 28px 22px;
  border-bottom: 1px solid var(--line);
}

.detail-icon {
  flex: 0 0 auto;
  width: 86px;
  height: 86px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background: linear-gradient(150deg, #1a2742, #0f1727);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.detail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-title {
  flex: 1;
  min-width: 0;
  padding-right: 36px;
}

.detail-title h2 {
  margin: 2px 0 4px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.detail-sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.detail-badges {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.badge.is-installed {
  border-color: rgba(45, 212, 167, 0.3);
  background: rgba(45, 212, 167, 0.09);
  color: #8df3d5;
}

.badge.is-update {
  border-color: rgba(255, 181, 71, 0.34);
  background: rgba(255, 181, 71, 0.1);
  color: #ffd28a;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.detail-actions .spacer {
  flex: 1;
}

.detail-body {
  padding: 24px 28px 30px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.detail-cell {
  padding: 13px 15px;
  background: #0c1421;
}

.detail-cell dt {
  margin: 0 0 4px;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-cell dd {
  margin: 0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-cell dd.mono {
  font-family: var(--mono);
  font-size: 11.5px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 26px 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.section-title:first-child {
  margin-top: 0;
}

.prose {
  color: #c4d0e4;
  font-size: 13.5px;
  line-height: 1.78;
}

.prose p {
  margin: 0 0 11px;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  margin: 20px 0 8px;
  color: var(--text);
  line-height: 1.35;
}

.prose h1 {
  font-size: 20px;
}
.prose h2 {
  font-size: 17px;
}
.prose h3 {
  font-size: 15px;
}
.prose h4 {
  font-size: 13.5px;
}

.prose ul,
.prose ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

.prose li {
  margin: 4px 0;
}

.prose code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.28);
  color: #d4e3ff;
  font-family: var(--mono);
  font-size: 0.9em;
}

.prose pre {
  margin: 12px 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.32);
}

.prose pre code {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  line-height: 1.65;
}

.prose a {
  color: #8fb7ff;
  text-decoration: underline;
  text-decoration-color: rgba(143, 183, 255, 0.35);
  text-underline-offset: 3px;
}

.prose blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  border-left: 2px solid rgba(91, 140, 255, 0.5);
  background: rgba(91, 140, 255, 0.06);
  color: var(--muted);
}

.shots {
  display: flex;
  gap: 12px;
  padding-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.shot {
  flex: 0 0 auto;
  width: min(360px, 74vw);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0a111c;
  overflow: hidden;
  transition: border-color 0.2s;
}

.shot:hover {
  border-color: var(--line-strong);
}

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

.notes {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  color: #c4d0e4;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.versions {
  display: flex;
  flex-direction: column;
}

.version-row {
  display: flex;
  gap: 13px;
  padding: 13px 4px;
  border-top: 1px solid var(--line);
}

.version-row:first-child {
  border-top: 0;
}

.version-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

.version-row.is-latest .version-dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.13);
}

.version-main {
  flex: 1;
  min-width: 0;
}

.version-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.version-name {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
}

.version-time {
  color: var(--dim);
  font-size: 10.5px;
}

.version-size {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
}

.version-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.version-actions .btn {
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 10.5px;
}

.version-notes {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ------------------------------------------------------------------ */
/* Guide & protocol                                                    */
/* ------------------------------------------------------------------ */

.guide-head {
  padding: 28px 28px 18px;
  border-bottom: 1px solid var(--line);
}

.guide-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.guide-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.guide-body {
  padding: 22px 28px 30px;
}

.guide-step {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.guide-step:first-child {
  border-top: 0;
  padding-top: 0;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(91, 140, 255, 0.35);
  border-radius: 9px;
  background: rgba(91, 140, 255, 0.12);
  color: #b9d0ff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.step-main {
  flex: 1;
  min-width: 0;
}

.step-main h3 {
  margin: 2px 0 5px;
  font-size: 14px;
}

.step-main p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.code-block {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.code-block code {
  flex: 1;
  min-width: 0;
  color: #cfe0ff;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-btn {
  flex: 0 0 auto;
  height: 27px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 10.5px;
}

.copy-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

.guide-note {
  display: flex;
  gap: 9px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 181, 71, 0.18);
  border-radius: 12px;
  background: rgba(255, 181, 71, 0.055);
  color: #d8c19a;
  font-size: 12px;
  line-height: 1.65;
}

.guide-note strong {
  color: #f3d7a6;
}

.guide-note > span {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1px solid rgba(255, 181, 71, 0.35);
  border-radius: 50%;
  color: #f3d7a6;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.prose hr {
  margin: 20px 0;
  border: 0;
  height: 1px;
  background: var(--line);
}

.protocol-body {
  padding: 24px 28px 30px;
}

.protocol-loading {
  padding: 60px;
  color: var(--muted);
  text-align: center;
}

/* confirm */

.confirm-body {
  padding: 4px 2px 0;
}

.confirm-body h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.confirm-body p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

/* ------------------------------------------------------------------ */
/* Toast                                                               */
/* ------------------------------------------------------------------ */

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 520px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(13, 21, 35, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.55;
  backdrop-filter: blur(18px);
  animation: toast-in 0.24s cubic-bezier(0.22, 0.8, 0.3, 1);
  pointer-events: auto;
}

.toast.is-out {
  animation: toast-out 0.2s ease forwards;
}

.toast-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.toast-success .toast-icon {
  background: rgba(45, 212, 167, 0.16);
  color: var(--teal);
}

.toast-error .toast-icon {
  background: rgba(255, 107, 107, 0.16);
  color: var(--red);
}

.toast-info .toast-icon {
  background: rgba(91, 140, 255, 0.16);
  color: var(--blue);
}

.toast strong {
  font-weight: 650;
}

.toast small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ------------------------------------------------------------------ */
/* Error state                                                         */
/* ------------------------------------------------------------------ */

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 440px;
  padding: 40px 20px;
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(255, 107, 107, 0.04);
  text-align: center;
}

.error-state .empty-mark {
  border-color: rgba(255, 107, 107, 0.25);
  background: rgba(255, 107, 107, 0.08);
  color: #ffc4c4;
}

.error-state h2 {
  margin: 20px 0 8px;
  font-size: 20px;
}

.error-state p {
  margin: 0 0 18px;
  max-width: 540px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: stretch;
  }

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 88px;
  }

  .stat {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-height: 88px;
    padding: 14px 15px;
  }

  .stat-hint {
    text-align: left;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar {
    height: 58px;
    padding: 0 15px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-tag {
    display: none;
  }

  .topbar-actions .btn span {
    display: none;
  }

  .topbar-actions .btn {
    width: 34px;
    padding: 0;
  }

  .page {
    width: calc(100% - 28px);
    padding-top: 28px;
  }

  .hero {
    padding-bottom: 30px;
  }

  .hero h1 {
    font-size: clamp(30px, 9vw, 42px);
  }

  .hero-sub {
    font-size: 14px;
    margin: 16px 0 22px;
  }

  .search-shell {
    height: 48px;
  }

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 78px;
    gap: 7px;
  }

  .stat {
    min-height: 78px;
    padding: 11px 12px;
    border-radius: 14px;
  }

  .stat-label {
    font-size: 10.5px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-hint {
    display: none;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
    font-size: 12px;
  }

  .toolbar-right {
    width: 100%;
    justify-content: flex-end;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .app-card {
    min-height: 218px;
    padding: 17px;
  }

  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
  }

  .detail-head {
    padding: 22px 18px 18px;
    gap: 14px;
  }

  .detail-icon {
    width: 68px;
    height: 68px;
    border-radius: 18px;
  }

  .detail-title {
    padding-right: 30px;
  }

  .detail-title h2 {
    font-size: 21px;
  }

  .detail-actions {
    padding: 13px 18px;
  }

  .detail-actions .spacer {
    display: none;
  }

  .detail-body {
    padding: 18px 18px 26px;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-head,
  .guide-body,
  .protocol-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .guide-head {
    padding-top: 22px;
  }

  .toast-root {
    bottom: 16px;
  }

  .footnote {
    flex-direction: column;
    align-items: flex-start;
  }

  .version-actions {
    width: 100%;
    margin-left: 0;
    margin-top: 6px;
  }

  .version-row {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}


body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.detail-icon .icon-fallback {
  font-size: 28px;
}
