:root {
  color-scheme: dark;
  --bg: #070c16;
  --surface: #0d1625;
  --surface-hover: #111d30;
  --border: #243249;
  --border-strong: #334662;
  --text: #f1f5fb;
  --muted: #8996aa;
  --subtle: #65728a;
  --blue: #2f75f6;
  --blue-hover: #4384ff;
  --green: #39d98a;
  --radius: 10px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 1100px; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 96% 0%, rgba(58, 55, 214, .16), transparent 28%),
    radial-gradient(circle at 0% 100%, rgba(36, 91, 196, .1), transparent 28%),
    var(--bg);
  color: var(--text);
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .09;
  pointer-events: none;
}

.ambient-one { top: -130px; left: -100px; background: #367cff; }
.ambient-two { right: -120px; bottom: -160px; background: #724cff; }

.site-header {
  height: 68px;
  border-bottom: 1px solid rgba(124, 144, 175, .23);
  background: rgba(7, 12, 22, .84);
  backdrop-filter: blur(18px);
}

.site-header-inner {
  width: min(1460px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(37, 97, 232, .24));
}

.brand-name { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name strong { font-size: 18px; letter-spacing: .02em; }
.brand-name small { margin-top: 5px; color: #6fa2ff; font-size: 12px; letter-spacing: .08em; }

.catalog {
  width: min(1490px, calc(100% - 40px));
  margin: 0 auto;
  padding: 15px 0 10px;
}

.catalog-section { margin-bottom: 14px; }
.catalog-section:last-child { margin-bottom: 0; }

.section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 9px 2px;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: .01em;
}

.section-title span { color: #5791ff; font-size: 17px; }

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

.resource-grid.services { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.resource-card {
  min-width: 0;
  min-height: 116px;
  padding: 10px;
  display: grid;
  grid-template-rows: auto 1fr 28px;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(17, 29, 48, .96), rgba(11, 20, 34, .96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.resource-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.resource-card.link-card .card-action { grid-row: 3; }

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

.app-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 9px;
  background: linear-gradient(145deg, hsl(var(--hue, 218) 80% 56%), hsl(calc(var(--hue, 218) + 34) 72% 39%));
  color: white;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -.02em;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .22);
}

.app-icon.has-image {
  padding: 5px;
  border-color: rgba(255, 255, 255, .16);
  background: #f6f8fb;
}

.app-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-icon.icon-uu-remote img {
  object-fit: cover;
  object-position: left center;
}

.app-name {
  min-width: 0;
  overflow: hidden;
  color: #f2f5fa;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px; align-content: center; }
.meta-block { min-width: 0; }
.meta-block + .meta-block { padding-left: 8px; border-left: 1px solid rgba(122, 143, 174, .16); }
.meta-label { display: block; margin-bottom: 2px; color: var(--subtle); font-size: 10px; }
.meta-value { display: block; overflow: hidden; color: #aeb8c8; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.card-action {
  width: 100%;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(88, 142, 255, .58);
  border-radius: 5px;
  background: linear-gradient(180deg, #3479f4, #2662d7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
  color: white;
  font-size: 12px;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease;
}

.card-action:hover { border-color: #79a5ff; background: linear-gradient(180deg, #4387ff, #2d6be7); }
.card-action[aria-disabled="true"] { cursor: not-allowed; border-color: #2a374b; background: #172235; color: #66758b; }

.service-card { min-height: 96px; grid-template-rows: auto 28px; }
.service-status { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 10px; }
.service-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

.loading-state,
.error-state { padding: 100px 0; color: var(--muted); text-align: center; }

footer {
  padding: 12px 0 20px;
  color: #657086;
  font-size: 12px;
  text-align: center;
}

footer a { color: inherit; text-decoration: none; }
footer a:hover { color: #91a4c1; }

@media (max-width: 1320px) {
  .resource-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .resource-grid.services { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
