body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f1115;
  color: #e5e7eb;
}

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

* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
}

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid #242834;
  background: rgba(15, 17, 21, 0.94);
  backdrop-filter: blur(14px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 72px;
  position: relative;
}

.site-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
}

.search-form {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
}

.search-input,
.form-control,
.form-select,
.form-textarea,
button {
  border-radius: 12px;
  border: 1px solid #2d3342;
  background: #161a22;
  color: #f3f4f6;
  padding: 10px 14px;
  font-size: 14px;
}

.search-input {
  width: 220px;
}

button,
.button {
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.button.secondary {
  background: #1f2937;
  border: 1px solid #364152;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  padding: 24px 0 48px;
}

.sidebar,
.panel,
.card,
.content-card,
.admin-card {
  background: #151922;
  border: 1px solid #252c39;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.sidebar {
  padding: 20px;
  position: sticky;
  top: 96px;
  height: fit-content;
}

.sidebar-title,
.section-title {
  font-size: 13px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.sidebar-link {
  display: block;
  padding: 11px 14px;
  border-radius: 12px;
  color: #cbd5e1;
  transition: 0.2s ease;
  margin-bottom: 8px;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: #1f2937;
  color: #fff;
}

.panel {
  padding: 22px;
  margin-bottom: 24px;
}

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

.panel-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.panel-desc {
  color: #94a3b8;
  font-size: 14px;
}

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

.software-card,
.list-item,
.version-chip {
  transition: 0.2s ease;
}

.software-card.card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
  min-height: 64px;
  border-radius: 10px;
}

.software-card.card .software-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: transparent;
}

.software-card.card .software-icon img {
  width: 100%;
  height: 100%;
}

.software-card-body {
  min-width: 0;
  flex: 1;
}

.software-card:hover,
.list-item:hover {
  transform: translateY(-4px);
  border-color: #3b82f6;
  background: #1a2030;
}

.software-icon,
.detail-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.software-icon img,
.detail-icon img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  display: block;
}

.software-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
}

.software-card .software-summary {
  display: none;
}

.software-summary,
.muted {
  color: #94a3b8;
  font-size: 13px;
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.list-item-main {
  flex: 1;
}

.accordion-item {
  border: 1px solid #2a3240;
  border-radius: 18px;
  background: #161b24;
  margin-bottom: 14px;
  overflow: hidden;
}

.accordion-trigger {
  width: 100%;
  background: transparent;
  border: none;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-start;
  text-align: left;
}

.accordion-panel {
  display: none;
  padding: 0 18px 18px 18px;
}

.accordion-item.active .accordion-panel {
  display: block;
}

.version-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.version-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: #1f2937;
  border: 1px solid #39465a;
  color: #dbeafe;
}

.version-chip:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.software-detail-card {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
}

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

.software-detail-title {
  margin: 6px 0 8px;
}

.empty-detail-panel {
  padding: 22px;
  border: 1px dashed #334155;
  border-radius: 18px;
  background: #111827;
}

.empty-detail-panel.compact {
  padding: 18px 22px;
}

.empty-detail-panel h2 {
  margin: 0 0 10px;
}

.empty-detail-panel p {
  margin: 0 0 8px;
  color: #e5e7eb;
  line-height: 1.75;
}

.detail-body {
  line-height: 1.85;
  color: #dbe4f0;
}

.detail-body p,
.detail-body ul,
.detail-body ol,
.detail-body blockquote,
.detail-body pre,
.detail-body h1,
.detail-body h2,
.detail-body h3,
.detail-body h4 {
  margin: 0 0 16px;
}

.detail-body ul,
.detail-body ol {
  padding-left: 22px;
}

.detail-body pre {
  padding: 14px 16px;
  background: #0b1220;
  border: 1px solid #243041;
  border-radius: 14px;
  overflow: auto;
}

.detail-body blockquote {
  margin-left: 0;
  padding: 12px 16px;
  border-left: 4px solid #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 12px;
}

.software-version-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.software-version-card {
  border: 1px solid #2a3240;
  border-radius: 16px;
  padding: 20px;
  background: #111827;
}

.software-version-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.software-version-head h3 {
  margin: 0 0 6px;
}

.software-version-summary {
  color: #94a3b8;
  margin-bottom: 14px;
  line-height: 1.75;
}

.version-body {
  margin-top: 14px;
}

.version-links,
.version-images {
  margin-top: 18px;
}

.detail-body > :first-child,
.version-body > :first-child {
  margin-top: 0;
}

.notice-box {
  background: #fff7ed;
  color: #9a3412;
  border-left: 4px solid #f97316;
  padding: 14px 16px;
  border-radius: 12px;
  margin: 18px 0 24px;
}

.detail-links,
.image-grid,
.stats-grid,
.admin-grid {
  display: grid;
  gap: 16px;
}

.detail-links {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 28px;
}

.link-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
}

.image-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin-top: 28px;
}

.image-card {
  border-radius: 16px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.image-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  cursor: zoom-in;
}

.ruancang-page {
  background: #191d23;
  color: #1f2937;
}

.ruancang-wrap {
  padding: 32px 16px 64px;
}

.ruancang-card {
  width: min(860px, 100%);
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #dfe5eb;
  border-radius: 8px;
  box-shadow: none;
  padding: 26px 24px 40px;
  color: #1f2937;
}

.ruancang-title {
  margin: 0;
  padding-bottom: 24px;
  border-bottom: 1px solid #edf0f3;
  font-size: 24px;
  line-height: 1.35;
  color: #24364d;
}

.ruancang-breadcrumb {
  margin-top: 16px;
}

.ruancang-summary {
  margin: 18px 0 0;
  color: #334155;
  line-height: 1.9;
}

.ruancang-summary.small {
  margin: 10px 0 0;
}

.ruancang-section {
  margin-top: 26px;
}

.ruancang-section-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  color: #24364d;
}

.ruancang-version-meta {
  margin-bottom: 10px;
}

.ruancang-body {
  color: #24364d;
  line-height: 2;
}

.ruancang-body a,
.ruancang-link-list a,
.ruancang-breadcrumb a {
  color: #2563eb;
  text-decoration: none;
}

.ruancang-body a:hover,
.ruancang-link-list a:hover,
.ruancang-breadcrumb a:hover {
  text-decoration: underline;
}

.ruancang-notice {
  background: #fdecec;
  color: #dc2626;
  border-left: none;
  border-radius: 4px;
  padding: 14px 18px;
  margin: 28px 0 0;
}

.ruancang-link-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #2563eb;
}

.ruancang-link-list li {
  margin: 10px 0;
  line-height: 1.9;
}

.ruancang-link-list span {
  display: inline;
  color: #64748b;
  margin-left: 8px;
  font-size: 13px;
}

.ruancang-note {
  display: block;
  margin-left: 0;
}

.ruancang-images {
  margin-top: 18px;
}

.footer {
  color: #94a3b8;
  text-align: center;
  padding: 24px 0 40px;
}

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

.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: #111827;
  border-right: 1px solid #1f2937;
  padding: 24px 18px;
}

.admin-main {
  background: #0f172a;
  padding: 24px;
}

.admin-nav a {
  display: block;
  padding: 11px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  color: #cbd5e1;
}

.admin-nav a.active,
.admin-nav a:hover {
  background: #1e293b;
  color: #fff;
}

.admin-card {
  padding: 22px;
}

.admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
  padding: 18px;
  border-radius: 18px;
  background: #111827;
  border: 1px solid #263041;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.table-wrap {
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid #273142;
  text-align: left;
  vertical-align: top;
  color: #dbe4f0;
  font-size: 14px;
}

.table th {
  color: #94a3b8;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.success {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.badge.muted {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.flash {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 18px;
}

.flash.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #bbf7d0;
}

.flash.error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fecaca;
}

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

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #cbd5e1;
  font-size: 14px;
}

.form-textarea {
  min-height: 140px;
  width: 100%;
  resize: vertical;
}

.form-control,
.form-select {
  width: 100%;
}

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

.empty-state {
  padding: 42px 16px;
  text-align: center;
  color: #94a3b8;
}

.software-editor-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.software-editor-section {
  padding: 22px;
  border: 1px solid #263041;
  border-radius: 18px;
  background: #111827;
}

.software-editor-title {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.software-editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.version-editor-block {
  padding: 18px;
  border: 1px solid #334155;
  border-radius: 18px;
  background: #0f172a;
}

.version-editor-block + .version-editor-block {
  margin-top: 18px;
}

.version-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #243244;
  flex-wrap: wrap;
}

.nested-editor-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #243244;
  background: #111827;
}

.nested-editor-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: #e5e7eb;
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.link-editor-row {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #2d3b4f;
  background: #0f172a;
}

.link-row-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.version-remove-button,
.remove-link-button {
  white-space: nowrap;
}

.modal-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 60;
}

.modal-viewer.active {
  display: flex;
}

.modal-viewer img {
  max-width: min(1100px, 100%);
  max-height: 90vh;
  border-radius: 16px;
}

@media (max-width: 960px) {
  .layout,
  .admin-shell,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .site-header-inner {
    min-height: auto;
    padding: 14px 0;
    display: block;
  }

  .search-form {
    position: static;
    transform: none;
    margin-top: 12px;
    justify-content: center;
  }

  .site-title {
    font-size: 22px;
  }

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

  .software-card.card {
    min-height: 60px;
    padding: 12px 14px;
  }

  .panel-header {
    align-items: flex-start;
  }

  .ruancang-wrap {
    padding: 24px 12px 48px;
  }

  .ruancang-card {
    padding: 22px 18px 32px;
  }

  .ruancang-title {
    font-size: 20px;
    padding-bottom: 18px;
  }
}
