:root {
  --bg-page: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-subtle: #eef2f7;
  --bg-muted: #f8fafc;
  --nav-top: #081726;
  --nav-main: #0d2238;
  --nav-border: #1d3958;
  --ink-primary: #121926;
  --ink-secondary: #3e4c5e;
  --ink-muted: #64748b;
  --border-light: #dce3ec;
  --border-strong: #c3cedb;
  --accent: #1659b2;
  --accent-hover: #0f448c;
  --accent-soft: #e8f1fc;
  --accent-border: #bfd6f6;
  --emerald: #0c7758;
  --emerald-bg: #e7f6f1;
  --emerald-border: #b5e4d4;
  --amber: #9a5b08;
  --amber-bg: #fef6e7;
  --amber-border: #f5d89e;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-border: #fecdca;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-modal: 0 20px 44px rgba(8, 23, 38, 0.28);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-primary);
  background-color: var(--bg-page);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

.container {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Top Telemetry Strip */
.topbar {
  background: var(--nav-top);
  color: #b7c8dc;
  font-size: 0.79rem;
  border-bottom: 1px solid #162e47;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 34px;
  padding-top: 4px;
  padding-bottom: 4px;
  flex-wrap: wrap;
}

.topbar-telemetry {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2dd498;
  box-shadow: 0 0 0 3px rgba(45, 212, 152, 0.18);
  margin-right: 6px;
  vertical-align: middle;
}

.topbar-sep {
  color: #365270;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
}

.topbar-links a {
  color: #c6d6e8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.topbar-links a:hover {
  color: #ffffff;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid #244363;
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.lang-btn {
  background: transparent;
  color: #9fb5ce;
  border: none;
  padding: 2px 7px;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
}

.lang-btn.active {
  background: #1d4268;
  color: #ffffff;
}

/* Main Header */
.site-header {
  background: var(--nav-main);
  color: #ffffff;
  border-bottom: 1px solid var(--nav-border);
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-upper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #ffffff;
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  color: #ffffff;
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-name span {
  color: #6cb8ff;
  font-weight: 600;
}

.brand-sub {
  font-size: 0.73rem;
  color: #93acc7;
  letter-spacing: 0.01em;
}

/* Global Search Bar */
.header-search {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.header-search form {
  display: flex;
  align-items: center;
  background: #081829;
  border: 1px solid #264769;
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-search form:focus-within {
  border-color: #5ca8f5;
  box-shadow: 0 0 0 2px rgba(92, 168, 245, 0.2);
}

.search-icon {
  width: 16px;
  height: 16px;
  margin-left: 11px;
  color: #7c97b6;
  flex-shrink: 0;
}

.header-search input {
  width: 100%;
  background: transparent;
  border: none;
  color: #f1f5f9;
  padding: 8px 10px;
  font-size: 0.88rem;
  outline: none;
}

.header-search input::placeholder {
  color: #7792b0;
}

.search-kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #88a2bf;
  background: #122a42;
  border: 1px solid #264769;
  border-radius: 3px;
  padding: 1px 6px;
  margin-right: 8px;
  user-select: none;
}

/* Header Auth Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  white-space: nowrap;
  line-height: 1.25;
}

.btn:hover {
  text-decoration: none;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.76rem;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.06);
  color: #e2ecf7;
  border-color: #2b4c70;
}

.btn-ghost-dark:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

.btn-accent-nav {
  background: #1f6feb;
  color: #ffffff;
  border-color: #347ff0;
}

.btn-accent-nav:hover {
  background: #195cc7;
  color: #ffffff;
}

.btn-download {
  background: #0e6f52;
  color: #ffffff;
  border-color: #0b5d44;
}

.btn-download:hover {
  background: #0a5840;
  color: #ffffff;
}

/* Primary Navigation Tabs */
.nav-bar {
  background: #102942;
  border-top: 1px solid #1a3757;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  color: #c5d6e8;
  font-size: 0.87rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.14s ease, background-color 0.14s ease;
}

.nav-list a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-list a.active {
  color: #ffffff;
  font-weight: 600;
  border-bottom-color: #58a6ff;
  background: rgba(88, 166, 255, 0.08);
}

.nav-count {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: #1c3c5e;
  color: #9ec7f2;
}

/* Policy / Mirror Notice Strip */
.policy-strip {
  background: #fffbeb;
  border-bottom: 1px solid #f2d694;
  color: #6b4306;
  font-size: 0.83rem;
}

.policy-strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  flex-wrap: wrap;
}

.policy-strip strong {
  color: #4f3003;
}

/* Main Content Wrapper */
.main-content {
  flex: 1;
  padding: 22px 0 44px;
}

/* Breadcrumb / Page Header */
.page-head {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.breadcrumb {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-head h1 {
  margin: 0 0 5px;
  font-size: 1.42rem;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
}

.page-head p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.91rem;
  max-width: 760px;
}

.page-head-stats {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.mini-stat {
  border-left: 2px solid var(--border-light);
  padding-left: 12px;
}

.mini-stat-val {
  font-family: var(--font-mono);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.mini-stat-lbl {
  font-size: 0.74rem;
  color: var(--ink-muted);
}

/* Spotlight Showcase on Homepage */
.spotlight-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  margin-bottom: 22px;
  overflow: hidden;
}

.spotlight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
  flex-wrap: wrap;
}

.section-kicker {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.spotlight-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.spot-tab {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 5px 10px;
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
}

.spot-tab:hover {
  border-color: var(--border-strong);
  color: var(--ink-primary);
}

.spot-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.spotlight-body {
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: 0;
}

.spotlight-media {
  background: #e9eef5;
  padding: 16px;
  border-right: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spotlight-media img {
  width: 100%;
  height: auto;
  max-height: 330px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}

.spotlight-info {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.spot-badges {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.spotlight-info h2 {
  margin: 0 0 6px;
  font-size: 1.32rem;
  letter-spacing: -0.015em;
}

.spotlight-info p {
  margin: 0 0 12px;
  color: var(--ink-secondary);
  font-size: 0.91rem;
  line-height: 1.55;
}

.spot-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  padding: 11px 13px;
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.81rem;
}

.spot-meta-item span {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.spot-meta-item strong {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-primary);
}

.spot-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-size: 0.73rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  line-height: 1.35;
  white-space: nowrap;
}

.badge-ver {
  font-family: var(--font-mono);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.badge-lic {
  font-family: var(--font-mono);
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.badge-verified {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.badge-patch {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.badge-os {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #dce3ec;
  font-size: 0.71rem;
  font-weight: 500;
}

/* Portal Grid (Main + Right Sidebar) */
.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  margin-bottom: 20px;
  overflow: hidden;
}

.panel-head {
  padding: 12px 16px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 16px;
}

/* Category Directory Grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.cat-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink-primary);
  text-decoration: none;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.cat-card:hover {
  border-color: var(--accent);
  background: #f9fbff;
  text-decoration: none;
}

.cat-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cat-meta strong {
  display: block;
  font-size: 0.84rem;
  color: var(--ink-primary);
  line-height: 1.25;
  margin-bottom: 2px;
}

.cat-meta span {
  font-size: 0.74rem;
  color: var(--ink-muted);
}

/* Dense Software Release Rows */
.pkg-list {
  display: flex;
  flex-direction: column;
}

.pkg-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid #eaEEF4;
  align-items: center;
  transition: background-color 0.12s ease;
}

.pkg-row:last-child {
  border-bottom: none;
}

.pkg-row:hover {
  background: #fafcff;
}

.pkg-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.pkg-main-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.pkg-title-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--ink-primary);
  cursor: pointer;
  text-align: left;
}

.pkg-title-btn:hover {
  color: var(--accent);
  text-decoration: underline;
}

.pkg-desc {
  margin: 0 0 6px;
  font-size: 0.84rem;
  color: var(--ink-secondary);
  line-height: 1.42;
}

.pkg-submeta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.mono {
  font-family: var(--font-mono);
}

.pkg-actions-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.pkg-dl-stats {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.pkg-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Data Tables (Updates & Changelogs) */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th {
  text-align: left;
  padding: 9px 13px;
  background: #f5f7fa;
  border-bottom: 1px solid var(--border-light);
  color: var(--ink-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 13px;
  border-bottom: 1px solid #eaeef4;
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #fafcff;
}

/* Sidebar Widgets */
.mirror-card-img {
  width: 100%;
  height: 132px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-light);
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.81rem;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e2e8f0;
}

.kv-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.kv-row span {
  color: var(--ink-muted);
}

.kv-row strong {
  font-family: var(--font-mono);
  font-size: 0.79rem;
  color: var(--ink-primary);
  text-align: right;
}

.top-dl-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.top-dl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #eaeef4;
  font-size: 0.83rem;
}

.top-dl-item:last-child {
  border-bottom: none;
}

.top-rank {
  width: 21px;
  height: 21px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.top-rank.top-3 {
  background: var(--accent-soft);
  color: var(--accent);
}

.top-dl-info {
  flex: 1;
  min-width: 0;
}

.top-dl-info strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.83rem;
}

.top-dl-info span {
  font-size: 0.73rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed-item {
  padding: 9px 14px;
  border-bottom: 1px solid #eaeef4;
  font-size: 0.78rem;
}

.feed-item:last-child {
  border-bottom: none;
}

.feed-time {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--emerald);
  font-weight: 600;
}

.feed-pkg {
  display: block;
  font-family: var(--font-mono);
  color: var(--ink-primary);
  margin: 2px 0;
  word-break: break-all;
}

.feed-sub {
  color: var(--ink-muted);
  font-size: 0.72rem;
}

/* Catalog Layout with Filter Sidebar */
.catalog-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.filter-group {
  margin-bottom: 16px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  margin-bottom: 8px;
}

.filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: 6px 9px;
  font-size: 0.83rem;
  color: var(--ink-secondary);
  cursor: pointer;
  text-align: left;
  margin-bottom: 2px;
}

.filter-option:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.filter-option.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
  font-weight: 600;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

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

.select-input, .text-input {
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: #ffffff;
  color: var(--ink-primary);
  font-size: 0.84rem;
}

.select-input:focus, .text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 89, 178, 0.15);
}

/* Prose / Docs / Legal Formatting */
.prose-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 20px;
}

.prose-card h2 {
  margin-top: 0;
  font-size: 1.15rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.prose-card h3 {
  font-size: 0.98rem;
  margin: 18px 0 6px;
}

.prose-card p, .prose-card li {
  color: var(--ink-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.code-block {
  background: #0d1b2a;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  line-height: 1.55;
  margin: 10px 0 14px;
  border: 1px solid #1e3a5f;
}

/* Modals (Package Detail & Registration Gate) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 34, 0.64);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  animation: modalFadeIn 0.16s ease-out;
}

.modal-dialog.modal-wide {
  max-width: 780px;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  background: var(--nav-main);
  color: #ffffff;
  border-bottom: 1px solid var(--nav-border);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 20px 22px;
}

/* Requested Artifact Banner inside Auth Modal */
.artifact-box {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  margin-bottom: 15px;
  font-size: 0.82rem;
}

.artifact-box-title {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink-primary);
  font-size: 0.85rem;
  word-break: break-all;
}

.artifact-box-sub {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
  margin-top: 3px;
}

.gate-notice {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: #6b4104;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  margin-bottom: 16px;
  line-height: 1.45;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
  gap: 4px;
}

.auth-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-field {
  margin-bottom: 13px;
}

.form-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 4px;
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  font-size: 0.88rem;
  color: var(--ink-primary);
  background: #ffffff;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 89, 178, 0.16);
}

.field-hint {
  font-size: 0.73rem;
  color: var(--ink-muted);
  margin-top: 3px;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-box {
  background: #0f243a;
  border: 1px solid #294a6e;
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ink-secondary);
  margin: 12px 0 15px;
}

.checkbox-row input {
  margin-top: 3px;
}

.form-alert {
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  margin-bottom: 13px;
  display: none;
}

.form-alert.error {
  display: block;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

/* Moderation Pending Card */
.moderation-box {
  background: #f8fafc;
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--amber);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.mod-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.moderation-box h4 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  color: var(--ink-primary);
}

.moderation-box p {
  margin: 0 0 10px;
  font-size: 0.86rem;
  color: var(--ink-secondary);
  line-height: 1.55;
}

.mod-ticket-meta {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  margin: 12px 0 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Footer */
.site-footer {
  background: #0a1929;
  color: #9cb2ca;
  border-top: 1px solid #1b3552;
  font-size: 0.82rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 28px;
  padding: 34px 0 26px;
}

.footer-col h4 {
  color: #ffffff;
  margin: 0 0 11px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 7px;
}

.footer-col a {
  color: #9cb2ca;
  text-decoration: none;
}

.footer-col a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid #162d46;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.77rem;
  color: #7993b0;
}

/* Responsive Breakpoints */
@media (max-width: 1040px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }
  .spotlight-body {
    grid-template-columns: 1fr;
  }
  .spotlight-media {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
  .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .catalog-layout {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .header-upper {
    flex-wrap: wrap;
  }
  .header-search {
    order: 3;
    max-width: 100%;
    flex-basis: 100%;
  }
  .pkg-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .pkg-actions-col {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
  }
  .form-grid-2,
  .mod-ticket-meta,
  .cat-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
