:root {
  --bg: #0a0f1a;
  --bg-raised: #0f1629;
  --bg-soft: #131b2e;
  --line: rgba(147, 197, 253, 0.18);
  --line-strong: rgba(147, 197, 253, 0.35);
  --text: #e0e7ff;
  --muted: #7c8db5;
  --blue: #60a5fa;
  --blue-strong: #3b82f6;
  --yellow: #f3c977;
  --cyan: #8adfe0;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    var(--bg);
  background-size: 100% 28px, 28px 100%, auto;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle at 70% 12%, rgba(84, 209, 126, 0.09), transparent 28rem);
  mix-blend-mode: screen;
  opacity: 0.7;
}

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.site-shell {
  width: min(100% - 48px, 1320px);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.brand,
.topbar-meta,
.hero-actions,
.terminal-lights,
.command-heading,
.command-form,
.footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--text);
}

.brand-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--blue);
  color: var(--blue);
  font-size: 17px;
  line-height: 1;
}

.topbar-meta {
  gap: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-strong);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12), 0 0 18px rgba(59, 130, 246, 0.8);
}

.meta-divider {
  color: var(--line-strong);
}

.icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  margin-left: 12px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: 180ms ease;
}

.icon-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(100px, 0.22fr) minmax(0, 1fr);
  gap: 42px;
}

.hero {
  min-height: 650px;
  align-items: center;
  padding: 106px 0 118px;
}

.hero-copy {
  grid-column: 2;
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.prompt-sign {
  margin-right: 9px;
  color: var(--yellow);
  font-size: 17px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-weight: 500;
  letter-spacing: -0.04em;
}

h1 {
  max-width: 730px;
  margin-bottom: 28px;
  font-size: clamp(54px, 8vw, 112px);
  line-height: 0.98;
}

.accent {
  color: var(--blue);
}

.hero-intro {
  max-width: 560px;
  margin-bottom: 42px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: 180ms ease;
}

.button span {
  margin-left: 18px;
  color: var(--yellow);
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--bg);
}

.button.primary:hover {
  background: #93c5fd;
  border-color: #93c5fd;
}

.button.ghost {
  background: transparent;
  color: var(--text);
}

.button.ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.terminal-card {
  grid-column: 1 / -1;
  width: min(100%, 700px);
  margin-left: auto;
  border: 1px solid var(--line-strong);
  background: rgba(7, 15, 10, 0.86);
  box-shadow: 18px 18px 0 rgba(96, 165, 250, 0.045);
}

.terminal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.terminal-lights {
  gap: 5px;
}

.terminal-lights i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.terminal-lights i:first-child {
  background: var(--yellow);
}

.terminal-lights i:last-child {
  background: var(--cyan);
}

.terminal-time {
  color: var(--blue);
}

.terminal-body {
  padding: 26px 28px 30px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.85;
}

.terminal-body p {
  margin-bottom: 18px;
}

.terminal-user {
  color: var(--cyan);
}

.terminal-path {
  color: var(--yellow);
}

.terminal-body pre {
  overflow-x: auto;
  margin: 0 0 18px;
  color: var(--text);
  font-family: inherit;
}

.key {
  color: var(--cyan);
}

.string {
  color: var(--blue);
}

.boolean {
  color: var(--yellow);
}

.cursor-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--blue);
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.ticker-band {
  display: flex;
  min-height: 54px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.ticker-label {
  display: grid;
  min-width: 88px;
  padding: 0 16px;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--yellow);
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 30px;
  overflow: hidden;
  padding: 0 25px;
  white-space: nowrap;
}

.ticker-separator {
  color: var(--blue);
}

.app-catalog {
  padding: 126px 0 112px;
  border-bottom: 1px solid var(--line);
  display: block;
}

.catalog-heading {
  align-items: flex-end;
}

.catalog-intro {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.8;
}

.catalog-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: -26px 0 28px;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
  transition: 180ms ease;
}

.filter-button:hover,
.filter-button.active {
  border-color: var(--blue);
  color: var(--blue);
}

.admin-link,
.admin-top-link {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.admin-link span {
  margin-left: 8px;
  color: var(--blue);
}

.admin-link:hover,
.admin-top-link:hover {
  color: var(--blue);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.app-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(13, 23, 17, 0.55);
  transition: 180ms ease;
}

.app-card:hover {
  transform: translateY(-5px);
  border-color: var(--blue);
  background: rgba(96, 165, 250, 0.07);
}

.app-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.52;
  border-bottom: 1px solid var(--line);
  background: #0d1711;
}

.app-card-image::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, transparent 55%, rgba(8, 16, 12, 0.62));
}

.app-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}

.app-card:hover .app-card-image img {
  transform: scale(1.035);
}

.app-card-index,
.app-card-arrow {
  position: absolute;
  z-index: 1;
  top: 15px;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 11px;
}

.app-card-index {
  left: 15px;
}

.app-card-arrow {
  right: 15px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 16, 12, 0.72);
  font-size: 10px;
}

.app-card-body {
  padding: 20px;
}

.app-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.app-card-meta span:last-child {
  color: var(--muted);
  text-align: right;
}

.app-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 500;
}

.app-card h3 span {
  color: var(--blue);
  font-size: 14px;
  font-weight: 400;
}

.app-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.catalog-loading {
  grid-column: 1 / -1;
  min-height: 126px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.catalog-error {
  color: var(--yellow);
}

.content-section {
  padding: 126px 0;
  border-bottom: 1px solid var(--line);
}

.section-index {
  padding-top: 7px;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 12px;
}

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

.section-heading .eyebrow {
  margin-bottom: 16px;
}

h2 {
  margin: 0;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 1;
}

.heading-cursor {
  margin-left: 10px;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.5em;
  letter-spacing: 0;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 90px;
}

.about-copy {
  max-width: 620px;
  color: var(--muted);
  font-size: 15px;
}

.about-copy .lead {
  margin-bottom: 28px;
  color: var(--text);
  font-size: 21px;
  line-height: 1.6;
}

.about-copy em {
  color: var(--blue);
  font-style: normal;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.stat {
  min-height: 140px;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat strong,
.stat span {
  display: block;
}

.stat strong {
  margin-bottom: 18px;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 400;
}

.stat span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.tool-list {
  border-top: 1px solid var(--line);
}

.tool-row {
  display: grid;
  grid-template-columns: 48px minmax(170px, 1fr) minmax(220px, 0.9fr) 30px;
  align-items: center;
  gap: 20px;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  transition: 180ms ease;
}

.tool-row:hover {
  padding: 0 12px;
  background: rgba(96, 165, 250, 0.05);
}

.tool-number,
.tool-note {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.tool-name {
  font-size: 18px;
}

.tool-symbol {
  color: var(--blue);
  font-size: 18px;
  text-align: right;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.link-card {
  display: flex;
  min-height: 180px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(13, 23, 17, 0.52);
  transition: 180ms ease;
}

.link-card:hover {
  transform: translateY(-4px);
  border-color: var(--blue);
  background: rgba(96, 165, 250, 0.07);
}

.link-card-top {
  display: flex;
  justify-content: space-between;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 10px;
}

.link-card strong {
  display: block;
  margin-top: auto;
  color: var(--text);
  font-size: 19px;
  font-weight: 500;
}

.link-card small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.command-section {
  padding: 108px 0 120px;
}

.command-window {
  border: 1px solid var(--line-strong);
  background: rgba(7, 15, 10, 0.8);
}

.command-heading {
  justify-content: space-between;
  min-height: 50px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.command-heading .eyebrow {
  margin: 0;
}

.command-hint {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.command-form {
  gap: 10px;
  padding: 24px 20px 12px;
  font-family: var(--mono);
  font-size: 12px;
}

.command-form label {
  white-space: nowrap;
}

.command-form input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
}

.command-form input::placeholder {
  color: #52665a;
}

.command-form button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--blue);
  cursor: pointer;
}

.command-form button:hover {
  border-color: var(--blue);
  background: rgba(96, 165, 250, 0.08);
}

.command-output {
  min-height: 32px;
  padding: 0 20px 24px;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 11px;
}

.footer {
  justify-content: space-between;
  min-height: 84px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.footer-center {
  color: var(--text);
}

.footer a:hover {
  color: var(--blue);
}

.footer-links {
  display: flex;
  gap: 18px;
}

.admin-shell {
  max-width: 1320px;
}

.admin-top-link {
  margin-left: 10px;
}

.admin-main {
  padding: 78px 0 110px;
}

.admin-heading {
  max-width: 760px;
  padding-bottom: 58px;
  border-bottom: 1px solid var(--line);
}

.admin-heading h1 {
  margin-bottom: 22px;
  font-size: clamp(48px, 7vw, 84px);
}

.admin-heading > p:last-child {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.admin-auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  gap: 42px;
  align-items: end;
  margin-top: 42px;
  padding: 24px;
  border: 1px solid var(--line-strong);
  background: rgba(13, 23, 17, 0.46);
}

.admin-auth h2 {
  margin: 0 0 12px;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.admin-auth p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-auth code {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 11px;
}

.auth-form {
  display: grid;
  gap: 9px;
}

.auth-form > label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.auth-input-row {
  display: flex;
  gap: 8px;
}

.auth-input-row input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  outline: none;
  background: rgba(8, 16, 12, 0.5);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
}

.auth-input-row input:focus {
  border-color: var(--blue);
}

.auth-input-row .button {
  white-space: nowrap;
}

.auth-status {
  min-height: 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.auth-status.working {
  color: var(--yellow);
}

.auth-status.error {
  color: var(--yellow);
}

.admin-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  padding-top: 46px;
}

.admin-sidebar,
.admin-editor {
  border: 1px solid var(--line);
  background: rgba(13, 23, 17, 0.46);
}

.admin-sidebar-heading,
.editor-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.admin-sidebar-heading .eyebrow,
.editor-topline .eyebrow {
  margin: 0;
}

.admin-sidebar-actions {
  display: flex;
  gap: 8px;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 10px;
}

.admin-app-list {
  padding: 10px;
}

.admin-app-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 20px;
  align-items: center;
  width: 100%;
  gap: 11px;
  padding: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: 180ms ease;
}

.admin-app-item:hover,
.admin-app-item.active {
  border-color: var(--line-strong);
  background: rgba(96, 165, 250, 0.06);
}
.admin-app-item-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-app-item-wrapper .admin-app-item {
  flex: 1;
  min-width: 0;
}

.admin-app-item-wrapper.active .admin-app-item {
  border-color: var(--line-strong);
  background: rgba(96, 165, 250, 0.06);
}

.admin-app-delete {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: all 180ms ease;
  opacity: 0;
}

.admin-app-item-wrapper:hover .admin-app-delete {
  opacity: 1;
}

.admin-app-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* Category Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

/* Ad Banner */
.ad-banner {
  padding: 40px 0;
  display: block;
}

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

.ad-item-link {
  text-decoration: none;
  color: inherit;
}

.ad-item-content {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  overflow: hidden;
  transition: border-color 180ms ease;
}

.ad-item-content:hover {
  border-color: var(--blue);
}

.ad-item-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--blue));
}

.ad-item-label {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ad-item-image {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 4px;
}

.ad-placeholder {
  grid-column: 1 / -1;
  padding: 40px 24px;
  text-align: center;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ad-placeholder p {
  font-size: 18px;
  color: var(--text);
  margin: 0 0 8px;
  font-family: var(--mono);
}

.ad-placeholder small {
  color: var(--muted);
  font-size: 12px;
}

.detail-ad {
  padding: 30px 0;
  margin-top: 40px;
}

.topbar-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 180ms ease;
  padding: 0;
}

.topbar-link:hover {
  color: var(--blue);
}

/* Wechat Modal */
.wechat-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.wechat-modal-content {
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  position: relative;
  max-width: 360px;
  width: 90%;
}

.wechat-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  transition: color 180ms ease;
}

.wechat-modal-close:hover {
  color: var(--text);
}

.wechat-modal-title {
  font-size: 16px;
  color: var(--text);
  margin: 0 0 20px;
  font-family: var(--mono);
}

.wechat-modal-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.wechat-modal-email {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 180ms ease;
}

.wechat-modal-email:hover {
  color: var(--blue);
}

/* Ad Manager in Admin */
.ad-manager {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ad-preview {
  width: 100%;
  min-height: 120px;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-preview img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}

.ad-preview span {
  color: var(--muted);
  font-size: 12px;
}

.ad-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ad-controls label span {
  font-size: 12px;
  color: var(--muted);
}

.ad-controls input[type="url"] {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--mono);
}

.ad-controls input[type="url"]:focus {
  border-color: var(--blue);
  outline: none;
}

.ad-divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0;
}

.ad-manager h3 {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 12px;
  font-family: var(--mono);
}

.ad-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 0;
}

.ads-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.ads-header h3 {
  margin: 0;
}

.ads-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ad-empty {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 12px;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 4px;
}

.ad-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.ad-item-preview {
  width: 120px;
  height: 80px;
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-item-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ad-item-preview span {
  font-size: 10px;
  color: var(--muted);
}

.ad-item-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ad-item-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ad-item-controls label span {
  font-size: 11px;
  color: var(--muted);
}

.ad-item-controls input[type="url"] {
  padding: 6px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--mono);
}

.ad-item-controls input[type="url"]:focus {
  border-color: var(--blue);
  outline: none;
}

.ad-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.modal-body {
  padding: 20px;
}

.categories-list {
  margin-bottom: 16px;
}

.category-item {
  display: grid;
  grid-template-columns: 120px 1fr 1fr 36px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.category-item input {
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--mono);
}

.category-item input:focus {
  border-color: var(--blue);
  outline: none;
}

.category-add-row {
  display: grid;
  grid-template-columns: 120px 1fr 1fr auto;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.category-add-row input {
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--mono);
}

.category-add-row input:focus {
  border-color: var(--blue);
  outline: none;
}

.admin-app-thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: var(--bg);
}

.admin-app-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-app-copy {
  min-width: 0;
}

.admin-app-copy strong,
.admin-app-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-app-copy strong {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 500;
}

.admin-app-copy small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.admin-app-arrow {
  color: var(--blue);
}

.admin-loading {
  padding: 22px 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.admin-error,
.save-status.error {
  color: var(--yellow);
}

.editor-topline h2 {
  margin: 10px 0 0;
  font-size: 24px;
  font-weight: 500;
}

.save-status {
  min-height: 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.save-status.working {
  color: var(--yellow);
}

.save-status.success {
  color: var(--blue);
}

.editor-form {
  padding: 28px;
}

.form-grid {
  display: grid;
  gap: 18px;
}

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

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: rgba(8, 16, 12, 0.5);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
}

.form-grid input,
.form-grid select {
  min-height: 42px;
  padding: 0 12px;
}

.form-grid textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.6;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--blue);
}

.form-grid input:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.upload-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px auto;
  gap: 18px;
  align-items: center;
  margin-top: 30px;
  padding: 18px;
  border: 1px solid var(--line);
}

.upload-panel .eyebrow {
  margin-bottom: 10px;
}

.upload-panel p {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
}

.upload-preview {
  overflow: hidden;
  aspect-ratio: 1.5;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.upload-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.file-picker {
  position: relative;
  display: inline-grid;
  min-height: 38px;
  padding: 0 12px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--blue);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
}

.file-picker:hover {
  border-color: var(--blue);
}

.file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.editor-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.detail-shell {
  max-width: 1320px;
}

.detail-main {
  padding-bottom: 40px;
}

.detail-hero {
  padding: 76px 0 74px;
  border-bottom: 1px solid var(--line);
}

.detail-breadcrumb {
  display: flex;
  gap: 12px;
  margin-bottom: 52px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.detail-breadcrumb a:hover {
  color: var(--blue);
}

.detail-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 80px;
  align-items: end;
}

.detail-heading h1 {
  margin-bottom: 26px;
}

.detail-tagline {
  max-width: 620px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 18px;
}

.detail-meta {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
}

.detail-meta div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
}

.detail-meta span {
  color: var(--muted);
  text-transform: uppercase;
}

.detail-meta strong {
  color: var(--blue);
  font-weight: 400;
  text-align: right;
}

.detail-visual {
  padding: 74px 0 92px;
}

.detail-image-frame {
  display: block;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  box-shadow: 20px 20px 0 rgba(96, 165, 250, 0.045);
  transition: 180ms ease;
}

.detail-image-frame:hover {
  border-color: var(--blue);
  transform: translateY(-4px);
}

.detail-image-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.image-label {
  position: absolute;
  right: 18px;
  bottom: 16px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 16, 12, 0.75);
  color: var(--blue);
  font-family: var(--mono);
  font-size: 10px;
}

.download-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 92px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.download-panel .eyebrow {
  margin: 0;
}

.download-panel a {
  overflow-wrap: anywhere;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
}

.download-panel a:hover {
  color: var(--text);
}

.detail-copy {
  padding: 0 0 110px;
}

.detail-copy-content {
  max-width: 920px;
}

.detail-description {
  max-width: 760px;
  margin-bottom: 52px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.9;
}

.detail-highlights {
  border-top: 1px solid var(--line);
}

.detail-highlight {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.detail-highlight span {
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 11px;
}

.detail-highlight p {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.detail-loading {
  min-height: 480px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.detail-loading a {
  margin-left: 12px;
  color: var(--blue);
}

body.light-mode {
  --bg: #edf5ef;
  --bg-raised: #f7fbf8;
  --bg-soft: #e5f0e7;
  --line: rgba(16, 43, 26, 0.16);
  --line-strong: rgba(16, 43, 26, 0.35);
  --text: #122019;
  --muted: #63776a;
  --blue: #1d4ed8;
  --blue-strong: #2563eb;
  --yellow: #a66b0d;
  --cyan: #147a86;
}

body.light-mode .terminal-card,
body.light-mode .command-window {
  background: rgba(247, 251, 248, 0.84);
}

body.light-mode .link-card {
  background: rgba(255, 255, 255, 0.42);
}

body.light-mode .app-card {
  background: rgba(255, 255, 255, 0.42);
}

body.light-mode .image-label {
  background: rgba(247, 251, 248, 0.82);
}

body.light-mode .admin-sidebar,
body.light-mode .admin-editor,
body.light-mode .admin-auth {
  background: rgba(255, 255, 255, 0.42);
}

body.light-mode .form-grid input,
body.light-mode .form-grid select,
body.light-mode .form-grid textarea {
  background: rgba(255, 255, 255, 0.62);
}

@media (max-width: 1199px) and (min-width: 800px) {
  .app-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .hero {
    grid-template-rows: auto auto;
  }

  .hero-copy {
    padding-top: 16px;
  }

  .terminal-card {
    grid-column: 2;
    margin-top: -40px;
  }
}

@media (max-width: 799px) {
  .site-shell {
    width: min(100% - 30px, 680px);
  }

  .section-grid {
    display: block;
  }

  .hero {
    min-height: auto;
    padding: 80px 0 84px;
  }

  .hero-copy {
    margin-bottom: 70px;
  }

  h1 {
    font-size: clamp(52px, 16vw, 84px);
  }

  .terminal-card {
    width: 100%;
  }

  .section-index {
    margin-bottom: 22px;
  }

  .content-section {
    padding: 82px 0;
  }

  .app-catalog {
    padding: 82px 0;
  }

  .catalog-heading {
    display: block;
  }

  .catalog-intro {
    max-width: 420px;
    margin-top: 22px;
  }

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

  .catalog-tools {
    align-items: flex-start;
    flex-direction: column;
    margin-top: -8px;
  }

  .footer-links {
    flex-direction: column;
    gap: 4px;
  }

  .admin-main {
    padding: 58px 0 80px;
  }

  .admin-auth {
    display: block;
    padding: 18px;
  }

  .auth-form {
    margin-top: 24px;
  }

  .admin-layout {
    display: block;
  }

  .admin-sidebar {
    margin-bottom: 18px;
  }

  .admin-app-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-form {
    padding: 18px;
  }

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

  .form-grid .full-width {
    grid-column: auto;
  }

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

  .upload-preview {
    max-width: 260px;
  }

  .editor-actions {
    flex-wrap: wrap;
  }

  .section-heading {
    display: block;
    margin-bottom: 38px;
  }

  .section-heading .eyebrow {
    margin-bottom: 18px;
  }

  .about-layout {
    display: block;
  }

  .about-copy {
    margin-bottom: 42px;
  }

  .tool-row {
    grid-template-columns: 32px 1fr 24px;
    gap: 10px;
    min-height: 78px;
  }

  .tool-note {
    grid-column: 2;
    grid-row: 2;
    margin-top: -25px;
    font-size: 10px;
  }

  .tool-symbol {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

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

  .link-card {
    min-height: 146px;
  }

  .command-section {
    padding: 82px 0;
  }

  .command-heading {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 12px 16px;
  }

  .command-form {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 20px 16px 12px;
  }

  .command-form input {
    flex: 1 1 150px;
  }

  .command-output {
    padding: 0 16px 20px;
  }

  .detail-hero {
    padding: 58px 0;
  }

  .detail-heading {
    display: block;
  }

  .detail-meta {
    margin-top: 52px;
  }

  .detail-visual {
    padding: 48px 0 70px;
  }

  .download-panel {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 70px;
  }

  .download-panel a {
    text-align: left;
  }

  .detail-copy {
    padding-bottom: 80px;
  }

  .detail-description {
    font-size: 16px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    min-height: 112px;
  }

  .footer-center {
    order: 3;
  }
}

/* Links Manager (Admin) */
.links-manager {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.link-item {
  display: flex;
  gap: 8px;
  align-items: center;
}
.link-item input {
  flex: 1;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  font-size: 0.85rem;
}
.link-item .link-name {
  max-width: 150px;
}
.link-item .remove-link {
  padding: 6px 10px;
  min-width: auto;
}

/* Description Images (Admin) */
.desc-images-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.desc-images-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.desc-image-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}
.desc-image-item img {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.desc-image-item span {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: monospace;
}
.desc-image-item .remove-desc-image {
  position: absolute;
  top: -6px;
  right: -6px;
  padding: 2px 6px;
  font-size: 0.7rem;
  min-width: auto;
  border-radius: 50%;
}
.desc-image-upload {
  display: flex;
  align-items: center;
  gap: 12px;
}
.desc-image-upload small {
  color: var(--muted);
  font-size: 0.75rem;
}
.desc-image-upload code {
  background: var(--surface);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.75rem;
}
.file-picker.small {
  display: inline-flex;
}
.file-picker.small span {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Links Panel (Detail Page) */
.links-panel {
  padding: 48px 0;
}
.links-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 600px;
}
.link-copy-button {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  color: var(--text);
  width: 100%;
}
.link-copy-button:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
}
.link-copy-name {
  font-weight: 600;
  min-width: 80px;
  font-size: 0.9rem;
}
.link-copy-url {
  flex: 1;
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
}
.link-copy-action {
  color: var(--accent);
  font-size: 0.8rem;
  white-space: nowrap;
  transition: all 0.2s;
}
.link-copy-button.copied .link-copy-action {
  color: var(--blue);
}
.no-links {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Inline Images in Description */
.desc-inline-image {
  max-width: 100%;
  border-radius: 8px;
  margin: 16px 0;
  border: 1px solid var(--border);
}

/* App Card Links */
.app-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.app-card-link {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.app-card-link:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}























