:root {
  --bg: #f6f7fb;
  --card-bg: #ffffff;
  --primary: #4f7cff;
  --primary-dark: #3a63d8;
  --text: #1f2330;
  --muted: #8a90a2;
  --border: #e6e8ef;
  --danger: #e8503a;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(31, 35, 48, 0.06);
  --shadow-lg: 0 8px 30px rgba(31, 35, 48, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.content { padding: 24px 20px 60px; }
.home-page .content {
  padding-top: 28px; padding-bottom: 64px;
}

/* ===== Header ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 700; color: var(--text); }
.logo-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 6px;
}
.logo:hover { color: var(--primary); }
.nav { display: flex; gap: 6px; }
.nav a {
  padding: 8px 16px; border-radius: 8px; color: var(--text);
  font-weight: 500; transition: background .15s;
}
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--primary); color: #fff; }

.header-search {
  display: flex; width: min(520px, 48vw); height: 40px; margin: 0 28px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.header-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,124,255,.1); }
.header-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; padding: 0 14px;
  color: var(--text); background: transparent; font: inherit; font-size: 14px;
}
.header-search button {
  flex: 0 0 auto; margin: 3px; padding: 0 18px; border: 0; border-radius: 6px;
  color: #fff; background: var(--primary); font: inherit; font-size: 14px; cursor: pointer;
}
.header-search button:hover { background: var(--primary-dark); }

/* ===== Hero ===== */
.hero {
  background: #fff; padding: 22px 24px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.home-page .hero { margin-bottom: 18px; padding: 18px 20px; border-radius: 0; }
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.hero-copy { flex: 0 0 auto; text-align: left; }
.hero h1 { font-size: 22px; margin-bottom: 1px; }
.hero p { color: var(--muted); font-size: 13px; }
.search-bar {
  display: flex; width: min(560px, 100%); margin: 0; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; padding: 4px;
}
.search-bar input {
  flex: 1; min-width: 0; border: none; outline: none; padding: 8px 12px;
  font-size: 14px; border-radius: 6px; background: transparent; color: var(--text);
}
.search-bar button {
  background: var(--primary); color: #fff; border: none;
  padding: 0 20px; border-radius: 6px; cursor: pointer; font-size: 14px;
  transition: background .15s;
}
.search-bar button:hover { background: var(--primary-dark); }

/* ===== Layout ===== */
.layout {
  display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 32px; align-items: start;
  min-width: 0;
}
.sidebar {
  background: var(--card-bg); border-radius: 14px;
  padding: 18px 14px; box-shadow: 0 4px 18px rgba(43,54,87,.06); position: sticky; top: 88px;
  border: 1px solid rgba(230,232,239,.75);
}
.home-page .sidebar { position: sticky; top: 88px; }
.sidebar-title { font-size: 13px; color: var(--muted); margin-bottom: 10px; padding: 0 12px; letter-spacing: .08em; }
.cat-list { list-style: none; }
.cat-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 10px; color: var(--text);
  font-size: 14px; transition: background .15s;
}
.category-label { display: flex; align-items: center; min-width: 0; gap: 10px; }
.category-name { overflow-wrap: anywhere; line-height: 1.35; }
.category-icon-text { flex: 0 0 20px; text-align: center; line-height: 1; }
.cat-list .category-icon { flex: 0 0 20px; margin-right: 0; }
.cat-list .badge { flex: 0 0 auto; margin-left: 10px; }
.cat-list a:hover { background: var(--bg); }
.cat-list a.active { background: linear-gradient(90deg, rgba(79,124,255,.13), rgba(111,92,255,.07)); color: var(--primary); font-weight: 600; }
.badge {
  background: var(--bg); color: var(--muted); font-size: 12px;
  padding: 1px 8px; border-radius: 10px; min-width: 22px; text-align: center;
}
.cat-list a.active .badge { background: var(--primary); color: #fff; }

.section-head {
  display: flex; justify-content: space-between; align-items: center; margin: 4px 0 18px;
}
.home-page .main-area { width: 100%; min-width: 0; }
.section-head h2 { font-size: 21px; letter-spacing: -.2px; }
.section-subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.section-head .muted { font-size: 13px; padding: 4px 10px; background: #fff; border-radius: 999px; }
.catalog-pagination { display:flex; justify-content:center; align-items:center; gap:14px; margin-top:28px; color:var(--muted); font-size:14px; }
.catalog-pagination a { padding:7px 12px; border:1px solid var(--border); border-radius:8px; background:#fff; }
.category-page-head { margin-bottom: 20px; }
.layout[data-catalog].is-loading [data-catalog-results] { opacity: .55; pointer-events: none; }
.layout[data-catalog] [data-catalog-results] { transition: opacity .15s ease; }
.category-page-head h1 { font-size: 26px; margin: 8px 0 2px; }
.category-icon { width: 32px; height: 32px; object-fit: contain; vertical-align: middle; border-radius: 6px; }
.category-icon-sm { width: 20px; height: 20px; margin-right: 3px; }
.category-icon-title { width: 34px; height: 34px; margin-right: 4px; }

/* ===== 软件信息列表 ===== */
.software-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.home-page .software-list { padding-bottom: 12px; }
.software-list-item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
  min-height: 106px;
  padding: 12px 18px 12px 12px;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid rgba(230,232,239,.9);
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(43,54,87,.05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.software-list-item:hover {
  color: var(--text);
  border-color: rgba(79,124,255,.36);
  box-shadow: 0 10px 26px rgba(43,54,87,.1);
  transform: translateY(-2px);
}
.software-list-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  padding: 12px;
  overflow: hidden;
  background: #f4f6fb;
  border: 1px solid #edf0f6;
  border-radius: 8px;
}
.software-list-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 16%;
  filter: drop-shadow(0 5px 8px rgba(31,35,48,.14));
  transition: transform .18s ease;
}
.software-list-item:hover .software-list-cover img { transform: scale(1.04); }
.software-list-cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 5px;
  overflow: hidden;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  background: #fff;
  border-radius: 8px;
}
.software-list-content { min-width: 0; }
.software-list-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 12px;
}
.software-list-heading h3 {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.software-list-heading .tag { flex: 0 0 auto; }
.software-list-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 26px;
  color: var(--muted);
  font-size: 12px;
}
.software-list-meta > span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.software-list-meta-label { color: var(--muted); }
.software-list-meta strong { color: #5f6678; font-weight: 500; overflow-wrap: anywhere; }
.software-list-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 86px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  border-left: 1px solid var(--border);
  transition: color .18s ease;
}
.software-list-action span:last-child { color: var(--primary); font-size: 18px; line-height: 1; }
.software-list-item:hover .software-list-action { color: var(--primary); }
.software-list-related { max-width: 880px; }

.tag {
  display: inline-block; background: rgba(79,124,255,.1); color: var(--primary);
  font-size: 12px; padding: 2px 10px; border-radius: 12px;
}
.tag-sm {
  display: inline-block; background: var(--bg); color: var(--muted);
  font-size: 12px; padding: 2px 8px; border-radius: 10px; margin-right: 6px;
}
.muted { color: var(--muted); }
.sm { font-size: 13px; }

.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty-icon { font-size: 48px; margin-bottom: 10px; }

/* ===== Detail Page ===== */
.detail-head {
  display: flex; gap: 24px; background: var(--card-bg);
  padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 28px; flex-wrap: wrap;
}
.detail-cover {
  width: 140px; height: 140px; border-radius: var(--radius); flex-shrink: 0;
  background: linear-gradient(135deg,#e8eeff,#f0e8ff); overflow: hidden;
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover-fallback {
  height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: var(--primary); text-align: center; padding: 8px;
}
.detail-info h1 { font-size: 26px; margin: 8px 0; }
.detail-info { flex: 1; min-width: 0; }
.detail-desc { color: var(--muted); margin: 8px 0 12px; }
.detail-meta { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.detail-summary {
  display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px; margin-top: 22px;
}
.detail-summary > div { padding: 12px 14px; background: var(--bg); border-radius: 8px; }
.detail-summary span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.detail-summary strong { font-size: 14px; }
.software-detail-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px; align-items: start; margin-bottom: 36px;
}
.software-detail-content { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.detail-panel, .resource-panel {
  background: var(--card-bg); padding: 22px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.detail-panel-title {
  margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--border);
  font-size: 18px;
}
.detail-description { color: var(--text); line-height: 1.8; }
.detail-tabs { display:flex; gap:24px; margin:-4px 0 20px; border-bottom:1px solid var(--border); }
.detail-tab { padding:10px 2px; border:0; border-bottom:3px solid transparent; background:transparent; color:var(--muted); font-size:16px; cursor:pointer; }
.detail-tab.active { border-bottom-color:var(--primary); color:var(--primary); font-weight:600; }
.tab-count { display:inline-block; min-width:20px; padding:1px 6px; margin-left:3px; border-radius:10px; background:var(--bg); font-size:12px; }
.detail-tab-panel[hidden] { display:none; }
.faq-article-list { display:flex; flex-direction:column; gap:10px; }
.faq-article-link { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 16px; border:1px solid var(--border); border-radius:8px; color:var(--text); font-weight:600; }
.faq-article-link:hover { border-color:var(--primary); background:rgba(79,124,255,.05); color:var(--primary); }
.faq-article-page { max-width:900px; margin:0 auto 40px; padding:30px 36px; background:var(--card-bg); border-radius:var(--radius); box-shadow:var(--shadow); }
.faq-article-head { padding:22px 0; border-bottom:1px solid var(--border); }
.faq-article-head h1 { margin:12px 0 8px; font-size:30px; line-height:1.35; }
.faq-article-content { padding:28px 0; min-height:180px; line-height:1.9; }
.faq-related-software { padding-top:20px; border-top:1px solid var(--border); }
.faq-related-software h2 { margin-bottom:12px; font-size:16px; }
.resource-panel { position: sticky; top: 86px; }
.resource-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.resource-item:last-child { padding-bottom: 0; border-bottom: 0; }
.resource-name { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.resource-icon { color: var(--primary); font-size: 19px; }
.resource-download { display: block; width: 100%; }
.resource-download-disabled {
  background: var(--bg); border: 1px solid var(--border); color: var(--muted);
  cursor: not-allowed; user-select: none;
}
.resource-download-disabled:hover { color: var(--muted); }
.related-section { clear: both; }

.version-section { margin-bottom: 36px; }
.section-title {
  font-size: 18px; margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.version-list { display: flex; flex-direction: column; gap: 12px; }
.version-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-bg); padding: 16px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow); flex-wrap: wrap; gap: 12px;
}
.version-main { display: flex; gap: 14px; align-items: flex-start; }
.version-no {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px;
  background: var(--primary); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.version-card h3 { font-size: 17px; margin-bottom: 6px; }
.version-tags { margin-bottom: 4px; }
.version-note { font-size: 13px; color: var(--muted); margin: 4px 0; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 8px;
  font-size: 14px; font-weight: 500; cursor: pointer; border: none;
  text-decoration: none; transition: all .15s; text-align: center;
}
.btn:hover { color: #fff; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); color: var(--text); }
.btn-copy { background: #fff; color: #287a55; border: 1px solid #65ad8b; }
.btn-copy:hover { background: #287a55; color: #fff; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ===== Admin ===== */
body.admin-page {
  --admin-bg: #eef1f6;
  --admin-dark: #0f172a;
  --admin-dark-2: #1e293b;
  --admin-dark-text: rgba(255,255,255,.72);
  --admin-dark-muted: rgba(255,255,255,.45);
  --admin-primary: #4f7cff;
  --admin-primary-dark: #3a63d8;
  --admin-success: #22a06b;
  --admin-success-dark: #1a8558;
  --admin-sidebar-primary: 200px;
  --admin-sidebar-secondary: 156px;
  background: var(--admin-bg);
  overflow: hidden;
}
body.admin-page .site-footer {
  display: none;
}
.admin-nav-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, var(--admin-primary), #22a06b, var(--admin-primary));
  background-size: 200% 100%;
  transition: opacity .12s ease;
}
.admin-nav-loading.is-visible {
  opacity: 1;
  animation: admin-nav-loading 1s linear infinite;
}
@keyframes admin-nav-loading {
  from { background-position: 0 0; }
  to { background-position: 200% 0; }
}
.admin-shell {
  display: flex;
  height: 100vh;
  width: 100%;
}
.admin-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}
.admin-topbar {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.admin-page-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
.admin-main-area {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 24px 28px;
}
.admin-nav {
  display: flex;
  flex-shrink: 0;
  height: 100vh;
  max-height: 100vh;
  position: sticky;
  top: 0;
  background: var(--admin-dark);
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
  z-index: 200;
  transition: width .2s ease;
  overflow: hidden;
}
.admin-nav-primary {
  display: flex;
  flex-direction: column;
  width: var(--admin-sidebar-primary);
  flex-shrink: 0;
  background: var(--admin-dark);
  border-right: 1px solid rgba(255,255,255,.06);
  min-height: 0;
}
.admin-nav-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.admin-nav-brand-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  color: #fff;
  text-decoration: none;
}
.admin-nav-brand-link:hover {
  color: #fff;
}
.admin-nav-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f7cff, #6f5cff);
  font-size: 20px;
  flex-shrink: 0;
}
.admin-nav-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.admin-nav-brand-text strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.admin-nav-brand-text small {
  display: block;
  font-size: 11px;
  color: var(--admin-dark-muted);
  line-height: 1.2;
  white-space: nowrap;
}
.admin-nav-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: rgba(255,255,255,.06);
  color: var(--admin-dark-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.admin-nav-secondary-head .admin-nav-collapse-btn {
  background: var(--admin-bg);
  color: var(--muted);
}
.admin-nav-secondary-head .admin-nav-collapse-btn:hover {
  background: #e8ebf2;
  color: var(--text);
}
.admin-nav-collapse-btn:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.admin-nav-groups {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.admin-nav-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--admin-dark-text);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, box-shadow .15s;
}
.admin-nav-group:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.admin-nav-group.is-active {
  background: linear-gradient(135deg, #4f7cff 0%, #5b8dff 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(79, 124, 255, 0.35);
}
.admin-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.admin-nav-icon svg {
  display: block;
}
.admin-nav-label {
  line-height: 1.35;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.admin-nav-user {
  padding: 12px 10px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.admin-runtime-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 4px;
  color: rgba(255,255,255,.55);
  font-size: 11px;
}
.admin-runtime-version code {
  max-width: 92px;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-logout-form {
  margin: 0;
}
.admin-logout-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: transparent;
  color: var(--admin-dark-text);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.admin-logout-btn:hover {
  background: rgba(232, 80, 58, 0.12);
  border-color: rgba(232, 80, 58, 0.35);
  color: #ff8a78;
}
.admin-nav-secondary {
  width: var(--admin-sidebar-secondary);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .2s ease, opacity .2s ease;
}
.admin-nav-secondary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--border);
}
.admin-nav-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.admin-nav-panels {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
}
.admin-nav-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-nav-panel[hidden] {
  display: none !important;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  transition: background .15s, color .15s;
}
.admin-nav-item:hover {
  background: var(--admin-bg);
  color: var(--admin-primary);
}
.admin-nav-item.is-active {
  background: rgba(79,124,255,.1);
  color: var(--admin-primary);
  font-weight: 600;
}
.admin-shell.admin-nav-collapsed-primary {
  --admin-sidebar-primary: 72px;
}
.admin-shell.admin-nav-collapsed-primary .admin-nav-label {
  display: none;
}
.admin-shell.admin-nav-collapsed-primary .admin-nav-brand-text {
  display: none;
}
.admin-shell.admin-nav-collapsed-primary .admin-nav-group {
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
  padding: 8px 4px;
}
.admin-shell.admin-nav-collapsed-primary .admin-nav-brand {
  justify-content: center;
  padding-left: 8px;
  padding-right: 8px;
}
.admin-shell.admin-nav-collapsed-secondary .admin-nav-secondary {
  width: 0;
  opacity: 0;
  pointer-events: none;
  border: 0;
}
.admin-shell.admin-nav-collapsed-secondary .admin-nav-collapse-btn[data-collapse="secondary"] svg {
  transform: rotate(180deg);
}
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.admin-toolbar-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}
.admin-toolbar-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.admin-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.analytics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.analytics-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.analytics-card-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.analytics-card-value {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}
.analytics-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: start;
}
.analytics-panel {
  margin-bottom: 0;
}
.analytics-panel .section-title {
  font-size: 15px;
  margin: 0 0 12px;
}
.analytics-side-panels {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (max-width: 960px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}
.admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}
.admin-head-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.software-category-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.software-category-filter label {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.admin-filter-select {
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
.category-admin-table .catalog-category-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.admin-head h1 {
  font-size: 20px;
}
.admin-main-area .btn-primary {
  background: var(--admin-success);
}
.admin-main-area .btn-primary:hover {
  background: var(--admin-success-dark);
  color: #fff;
}
.admin-filter {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.admin-filter input,
.admin-filter select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  min-width: 180px;
}
.image-upload-bar {
  align-items: center;
}
.image-upload-trigger {
  position: relative;
  cursor: pointer;
  margin: 0;
}
.image-upload-status {
  min-height: 20px;
}
.software-admin-table {
  margin-bottom: 18px;
}
.admin-software {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}
.admin-software.empty {
  padding: 40px 20px;
}
.admin-table-wrap {
  overflow-x: auto;
}
.admin-software.admin-table-wrap {
  overflow-x: auto;
}
.admin-software .version-table th:first-child,
.admin-software .version-table td:first-child {
  padding-left: 16px;
}
.admin-software .version-table th:last-child,
.admin-software .version-table td:last-child {
  padding-right: 16px;
}
.admin-main-area .version-table {
  table-layout: auto;
}
.admin-main-area .version-table th {
  background: #f8f9fc;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-main-area .version-table td {
  vertical-align: middle;
}
.admin-main-area .version-table .col-drag {
  width: 40px;
}
.admin-main-area .version-table td:nth-child(2) {
  width: 56px;
}
.admin-main-area .catalog-software-table td:nth-child(3) {
  width: 56px;
}
.admin-main-area .version-table tbody tr:hover {
  background: rgba(79,124,255,.03);
}
.admin-main-area .form-wrap {
  max-width: none;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.admin-main-area .software-form-wrap {
  padding: 18px 20px 20px;
}
.admin-main-area .dictionary-form {
  position: sticky;
  top: 12px;
}
.admin-main-area .dictionary-selector,
.admin-main-area .generator-form,
.admin-main-area .dictionary-card {
  border: 1px solid var(--border);
}

/* ===== Catalog Admin ===== */
.catalog-layout {
  display: grid;
  grid-template-columns: minmax(240px, 28%) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.catalog-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-height: 420px;
  min-width: 0;
  overflow: hidden;
}
.catalog-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafbfe;
}
.catalog-panel-head h2 {
  font-size: 16px;
  font-weight: 600;
}
.catalog-panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.catalog-categories {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}
.catalog-categories .catalog-category-list {
  flex: 1;
  overflow-y: auto;
}
.catalog-category-list {
  list-style: none;
  margin: 0;
  padding: 8px;
}
.catalog-category-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-areas:
    "drag link"
    "drag actions";
  gap: 2px 6px;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  align-items: start;
}
.catalog-category-item.active {
  background: rgba(79,124,255,.08);
  border-color: rgba(79,124,255,.25);
}
.catalog-category-item .drag-handle {
  grid-area: drag;
  margin-top: 6px;
}
.catalog-category-link {
  grid-area: link;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 4px 6px;
  color: var(--text);
}
.catalog-category-link:hover { color: var(--primary); }
.catalog-category-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 6px;
}
.catalog-category-icon img,
.catalog-category-icon .category-icon {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px;
  max-height: 28px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
}
.catalog-category-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}
.catalog-category-count {
  font-size: 12px;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}
.catalog-item-actions {
  grid-area: actions;
  display: flex;
  gap: 4px;
  align-items: center;
  padding-left: 42px;
  opacity: 0;
  transition: opacity .15s;
}
.catalog-category-item:hover .catalog-item-actions,
.catalog-category-item.active .catalog-item-actions {
  opacity: 1;
}
.catalog-item-actions form { margin: 0; }
.catalog-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}
.catalog-software {
  display: flex;
  flex-direction: column;
  min-height: 420px;
}
.catalog-software .admin-table-wrap {
  flex: 1;
  padding: 0 12px 12px;
}
.catalog-software-table .col-drag { width: 36px; }
.catalog-cover {
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--muted);
  cursor: grab;
  user-select: none;
  font-size: 16px;
}
.drag-handle:active { cursor: grabbing; }
.sortable-ghost {
  opacity: .45;
  background: rgba(79,124,255,.08);
}

.version-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.version-table th, .version-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
}
.version-table th { color: var(--muted); font-weight: 500; font-size: 13px; }
.link-cell a {
  display: inline-block; max-width: 240px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}

/* ===== Auth ===== */
body:has(.auth-page) .site-footer {
  display: none;
}
.content:has(.auth-page) {
  padding: 12px 20px;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-page {
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 0;
}
.auth-card {
  width: 100%;
  margin: 0;
  padding: 22px 24px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.auth-brand .logo-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 8px;
}
.auth-brand h1 {
  font-size: 20px;
  margin-bottom: 2px;
}
.auth-brand p {
  margin: 0;
}
.auth-error {
  background: rgba(232, 80, 58, 0.08);
  color: var(--danger);
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
}
.auth-form .form-row {
  margin-bottom: 12px;
}
.auth-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.auth-form-foot .btn {
  min-width: 96px;
  padding: 10px 18px;
}
.form-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.form-check input {
  width: auto;
  margin: 0;
}
.btn-block {
  width: 100%;
  justify-content: center;
}

/* ===== Forms ===== */
.form-wrap {
  max-width: 680px; margin: 0 auto; background: var(--card-bg);
  padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.software-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
  margin-bottom: 12px;
}
.software-form .form-row { margin-bottom: 12px; }
.software-form-grid .form-row { margin-bottom: 0; }
.software-form .form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.software-form .form-row.two-col > div {
  min-width: 0;
}
.software-form-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.form-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.form-head h1 { font-size: 22px; }
.back-link { font-size: 14px; }
.info-box {
  background: rgba(79,124,255,.08); color: var(--primary);
  padding: 10px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 14px;
}
.form-row { margin-bottom: 18px; }
.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row label {
  display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px;
}
.req { color: var(--danger); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
  transition: border-color .15s; background: #fff; color: var(--text);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--primary);
}
.form-row textarea { resize: vertical; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }
.software-form { padding-bottom: 6px; }
.sticky-form-actions {
  position: sticky; bottom: 12px; z-index: 30;
  margin: 28px -14px -14px; padding: 14px;
  background: rgba(255,255,255,.94); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 -8px 24px rgba(15,23,42,.10);
  backdrop-filter: blur(8px);
}
.sticky-form-actions .btn-primary { min-width: 132px; }
.image-picker { display:flex; flex-wrap:wrap; gap:10px; }
.image-picker-item { display:flex; flex-direction:column; gap:4px; padding:4px; border:1px solid var(--border); border-radius:6px; cursor:pointer; }
.image-picker-item img { width:80px; height:56px; object-fit:cover; border-radius:4px; }
.image-usage-list { display:flex; flex-direction:column; gap:4px; min-width:180px; }
.image-usage-list a { font-size:13px; }
.image-field-row { display:flex; gap:8px; align-items:center; }
.image-field-row input { flex:1; }
.image-field-row .btn { white-space:nowrap; }
.selected-image-preview { margin-top:10px; }
.selected-image-preview img { width:120px; height:80px; object-fit:cover; border-radius:6px; border:1px solid var(--border); }
body.modal-open { overflow:hidden; }
.image-picker-modal { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; padding:20px; }
.image-picker-modal[hidden] { display:none; }
.image-picker-backdrop { position:absolute; inset:0; width:100%; border:0; background:rgba(15,23,42,.55); cursor:default; }
.image-picker-dialog { position:relative; width:min(780px, 100%); max-height:min(720px, calc(100vh - 40px)); display:flex; flex-direction:column; background:#fff; border-radius:12px; box-shadow:0 24px 60px rgba(0,0,0,.25); overflow:hidden; }
.image-picker-head { display:flex; align-items:flex-start; justify-content:space-between; padding:20px 22px 14px; border-bottom:1px solid var(--border); }
.image-picker-head h2 { font-size:20px; }
.image-picker-close { border:0; background:transparent; color:var(--muted); font-size:28px; line-height:1; cursor:pointer; }
.image-picker-upload { display:flex; gap:10px; align-items:center; padding:14px 22px; background:var(--bg); border-bottom:1px solid var(--border); }
.image-picker-upload input { flex:1; min-width:0; }
.image-picker-grid { min-height:0; padding:18px 22px; display:grid; grid-template-columns:repeat(auto-fill,minmax(min(130px,100%),1fr)); grid-auto-rows:max-content; align-content:start; gap:12px; overflow-y:auto; }
.image-picker-option { position:relative; display:flex; flex-direction:column; gap:6px; padding:7px; border:2px solid var(--border); border-radius:8px; cursor:pointer; overflow:hidden; }
.image-picker-option:has(input:checked) { border-color:var(--primary); background:rgba(79,124,255,.07); }
.image-picker-option input { position:absolute; z-index:1; top:10px; left:10px; width:16px; height:16px; accent-color:var(--primary); }
/* 正方形预览不参与弹窗纵向压缩，横图和竖图完整居中显示。 */
.image-picker-preview { position:relative; width:100%; aspect-ratio:1; flex:none; border-radius:5px; background:var(--bg); overflow:hidden; }
.image-picker-option .image-picker-preview img { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:contain; }
.image-picker-option span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; color:var(--muted); }
.image-picker-empty { grid-column:1/-1; align-self:center; text-align:center; }
.image-picker-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; padding:14px 22px; border-top:1px solid var(--border); }
.image-picker-message { margin-right:auto; color:var(--success); font-size:13px; }
.image-picker-message.error { color:var(--danger); }
.faq-checkbox-list { display:flex; flex-direction:column; gap:8px; max-height:240px; overflow:auto; padding:10px; border:1px solid var(--border); border-radius:8px; }
.faq-checkbox-list label { display:flex; align-items:flex-start; gap:7px; padding:5px; cursor:pointer; }
.faq-checkbox-list input { width:auto; margin-top:3px; }
.dictionary-list { display:flex; flex-direction:column; gap:14px; }
.dictionary-card { padding:18px; background:var(--card-bg); border-radius:var(--radius); box-shadow:var(--shadow); }
.dictionary-card code, .dictionary-hints code { display:inline-block; padding:3px 7px; background:var(--bg); border-radius:5px; color:var(--primary); }
.dictionary-selection-preview { flex-basis:100%; padding-top:4px; color:var(--muted); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.generator-form { padding:22px; background:#fff; border-radius:var(--radius); box-shadow:var(--shadow); }
.generator-source { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; padding-bottom:20px; border-bottom:1px solid var(--border); }
.generator-source h2 { margin:4px 0 8px; font-size:20px; }
.generator-source-software { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:7px; max-width:45%; }
.generator-match-section { margin-top:22px; }
.generator-match-section h2 { margin-bottom:5px; font-size:18px; }
.generator-match-list { display:grid; gap:8px; margin-top:14px; }
.generator-match-item { display:grid; grid-template-columns:minmax(130px,.4fr) 100px minmax(0,1fr); align-items:center; gap:12px; padding:11px 13px; border:1px solid var(--border); border-radius:8px; }
.generator-match-item code { color:var(--primary); }
.generator-step { display:flex; align-items:flex-start; gap:12px; margin:26px 0 16px; padding-top:22px; border-top:1px solid var(--border); }
.generator-step:first-child { margin-top:0; padding-top:0; border-top:0; }
.generator-step h2 { margin:0 0 3px; font-size:18px; }
.generator-step-number { display:grid; place-items:center; flex:0 0 28px; width:28px; height:28px; border-radius:50%; background:var(--primary); color:#fff; font-weight:700; }
.generator-editor-content { min-height:300px; }
.replacement-tool { padding:16px; border:1px solid var(--border); border-radius:8px; background:var(--bg); }
.replacement-tool-row { display:grid; grid-template-columns:minmax(220px, 1fr) minmax(220px, 1fr); gap:12px; }
.replacement-tool-row label { display:flex; flex-direction:column; gap:7px; font-weight:600; }
.replacement-tool-row input, .replacement-tool-row select { width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--text); }
.replacement-tool-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:12px; }
.replacement-tool-actions .muted { flex:1 1 260px; }
.generator-combination-summary { margin-top:12px; padding:12px 14px; border-left:3px solid var(--success); background:rgba(28,163,108,.07); color:var(--text); }
.generator-combination-summary.is-error { border-left-color:var(--danger); background:rgba(220,53,69,.06); }
.generator-seo-rule { display:flex; flex-wrap:wrap; gap:8px 16px; margin-bottom:20px; padding:12px 14px; border-radius:8px; background:rgba(79,124,255,.07); color:var(--muted); font-size:13px; }
.generator-seo-rule strong { color:var(--primary); }
.generator-results { margin-top:28px; padding-top:22px; border-top:2px solid var(--border); }
.generator-results h2 { margin-bottom:6px; }
.generator-results table { margin:14px 0; }
.dictionary-create { margin:0 0 16px; padding:18px; }
.dictionary-create[hidden] { display:none; }
.compact-dictionary-list .dictionary-card { padding:0; overflow:hidden; }
.compact-dictionary-list summary { display:grid; grid-template-columns:minmax(180px,.8fr) minmax(240px,1fr) auto; align-items:center; gap:16px; padding:16px 18px; cursor:pointer; list-style:none; }
.compact-dictionary-list summary::-webkit-details-marker { display:none; }
.compact-dictionary-list summary > div { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.dictionary-card-meta { min-width:0; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dictionary-card-form { padding:18px; border-top:1px solid var(--border); }

.rich-editor { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.rich-editor:focus-within { border-color: var(--primary); }
.rich-toolbar {
  display: flex; align-items: center; gap: 4px; padding: 7px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.rich-toolbar button {
  min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid transparent;
  background: transparent; color: var(--text); border-radius: 5px; cursor: pointer;
  font-family: inherit;
}
.rich-toolbar button:hover { background: #fff; border-color: var(--border); }
.rich-toolbar button:disabled { color: var(--muted); cursor: wait; }
.rich-editor-content { min-height: 150px; padding: 12px; outline: none; overflow-wrap: anywhere; }
.rich-editor-content img, .rich-content img { display: block; max-width: 100%; height: auto; margin: 12px 0; border-radius: 6px; }
.rich-editor-content ul, .rich-editor-content ol, .rich-content ul, .rich-content ol { padding-left: 24px; }
.rich-content { overflow-wrap: anywhere; }
.rich-content p, .rich-content ul, .rich-content ol { margin-bottom: 10px; }
.rich-content a { text-decoration: underline; }

/* ===== Footer ===== */
.site-footer {
  text-align: center; padding: 24px 20px; color: var(--muted);
  border-top: 1px solid var(--border); font-size: 13px;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .header-search { flex: 1; width: auto; margin: 0 14px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-width: 0; position: static; padding: 14px; overflow: hidden; }
  .home-page .layout { width: 100%; min-width: 0; gap: 12px; }
  .home-page .sidebar { height: auto; min-height: auto; flex: 0 0 auto; }
  .home-page .cat-list { overflow-x: auto; overflow-y: hidden; padding-right: 0; }
  .home-page .main-area { overflow: hidden; }
  .cat-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .cat-list li { flex: 0 0 auto; }
  .cat-list a { gap: 10px; white-space: nowrap; }
  .software-list-item { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; }
  .software-list-cover { width: 72px; height: 72px; padding: 10px; }
  .admin-shell {
    flex-direction: column;
    min-height: auto;
  }
  .admin-nav {
    position: static;
    height: auto;
    width: 100%;
    flex-direction: column;
  }
  .admin-nav-primary {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  .admin-nav-brand {
    flex: 0 0 auto;
    min-width: auto;
    border-bottom: 0;
  }
  .admin-nav-groups {
    flex: 1;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px;
  }
  .admin-nav-group {
    flex: 1;
    min-width: 72px;
    min-height: 52px;
  }
  .admin-nav-user {
    display: flex;
    align-items: center;
    border-top: 0;
    border-left: 1px solid rgba(255,255,255,.06);
    padding: 8px;
  }
  .admin-nav-secondary {
    width: 100%;
    opacity: 1;
    pointer-events: auto;
  }
  .admin-nav-panels {
    padding: 8px 10px 10px;
  }
  .admin-nav-panel {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  .admin-nav-panel[hidden] {
    display: none !important;
  }
  .admin-nav-secondary-head {
    width: 100%;
  }
  .admin-nav-item {
    flex: 1;
    justify-content: center;
    min-width: 120px;
  }
  .admin-body {
    height: auto;
    min-height: auto;
  }
  .admin-topbar {
    padding: 12px 16px;
  }
  .admin-main-area {
    padding: 16px;
  }
  body.admin-page {
    overflow: auto;
  }
  .hero h1 { font-size: 24px; }
  .form-row.two-col { grid-template-columns: 1fr; }
  .software-detail-layout { grid-template-columns: 1fr; }
  .resource-panel { position: static; }
  .dictionary-layout { grid-template-columns:1fr; }
  .dictionary-form { position:static; }
  .replacement-tool-row { grid-template-columns:1fr; }
  .generator-source { flex-direction:column; }
  .generator-source-software { justify-content:flex-start; max-width:none; }
  .generator-match-item { grid-template-columns:1fr auto; }
  .generator-match-item .muted { grid-column:1 / -1; }
  .compact-dictionary-list summary { grid-template-columns:1fr auto; }
  .dictionary-card-meta { grid-column:1 / -1; grid-row:2; }
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-item-actions { opacity: 1; }
  .software-form-grid { grid-template-columns: 1fr; }
  .software-form .form-row.two-col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .home-page .container { padding-left: 14px; padding-right: 14px; }
  .home-page .content { padding-top: 16px; padding-bottom: 40px; }
  .home-page .header-inner { height: auto; min-height: 64px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .home-page .logo { font-size: 19px; }
  .home-page .logo-icon { width: 24px; height: 24px; }
  .home-page .nav a { padding: 6px 10px; }
  .header-search { order: 3; flex: 0 0 100%; width: 100%; height: 38px; margin: 8px 0 0; }
  .home-page .hero { margin: 0 -14px 12px; padding: 14px; }
  .hero-inner { align-items: stretch; flex-direction: column; gap: 10px; }
  .hero-copy { display: flex; align-items: baseline; gap: 8px; }
  .hero h1 { font-size: 20px; }
  .hero p { font-size: 12px; }
  .search-bar { padding: 4px; }
  .search-bar input { min-width: 0; padding: 10px 13px; font-size: 13px; }
  .search-bar button { padding: 0 18px; }
  .layout { gap: 22px; }
  .section-head { align-items: flex-start; gap: 12px; }
  .section-head h2 { font-size: 19px; }
  .software-list { gap: 10px; }
  .software-list-item {
    grid-template-columns: 62px minmax(0, 1fr) 24px;
    gap: 11px;
    min-height: 88px;
    padding: 10px;
  }
  .software-list-cover { width: 62px; height: 62px; padding: 9px; }
  .software-list-heading { align-items: flex-start; gap: 7px; margin-bottom: 7px; }
  .software-list-heading h3 { font-size: 15px; }
  .software-list-meta { display: grid; gap: 2px; }
  .software-list-meta > span { gap: 6px; }
  .software-list-action { min-width: 24px; padding-left: 8px; border-left: 0; }
  .software-list-action span:first-child { display: none; }
  .tag { font-size: 11px; padding: 2px 8px; }
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-toolbar-actions {
    width: 100%;
  }
  .admin-toolbar-actions .btn {
    flex: 1;
  }
  .admin-head { align-items: flex-start; gap: 12px; flex-direction: column; }
  .admin-head-actions { width: 100%; }
  .admin-head-actions .btn { flex: 1; }
  .admin-head .btn { padding: 8px 12px; }
  .admin-page-title { font-size: 16px; }
  .admin-nav-label {
    display: none;
  }
  .admin-filter input, .admin-filter select { width: 100%; min-width: 0; }
  .version-card { align-items: flex-start; }
  .version-table { font-size: 12px; }
  .version-table th, .version-table td { padding: 8px 6px; }
  .detail-head { padding: 18px; }
  .detail-cover { width: 110px; height: 110px; }
  .detail-summary { grid-template-columns: 1fr; gap: 8px; }
  .detail-panel, .resource-panel { padding: 18px; }
  .sticky-form-actions { bottom: 8px; margin-left:-8px; margin-right:-8px; padding:10px; }
  .sticky-form-actions .btn { flex:1; padding-left:10px; padding-right:10px; }
  .faq-article-page { padding:22px 18px; }
  .faq-article-head h1 { font-size:24px; }
}

/* 图片相册：等宽卡片完整展示图片，窄屏自动换列。 */
.image-album { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
.image-album-card { background:#fff; border:1px solid var(--border,#e5e7eb); border-radius:12px; overflow:hidden; }
.image-album-preview { display:flex; align-items:center; justify-content:center; height:110px; padding:8px; background:#f7f9fc; }
.image-album-preview img { width:100%; height:100%; object-fit:contain; }
.image-album-info { padding:9px; display:flex; flex-direction:column; gap:4px; }
.image-album-usage { min-height:20px; font-size:12px; }
.image-album-usage summary { cursor:pointer; }
.image-album-usage .image-usage-list { padding:8px 0; min-width:0; overflow-wrap:anywhere; }
.image-album-info button:disabled { cursor:not-allowed; opacity:.6; }
@media(max-width:520px) { .image-album { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; } .image-album-preview { height:100px; padding:8px; } .image-album-info { padding:10px; } }

/* 图片页压缩工具区，给相册留下更多可见空间。 */
.image-management-toolbar{padding:10px 14px;margin-bottom:12px;gap:12px;flex-wrap:wrap}
.image-management-toolbar .btn{padding:7px 12px}

/* 上传队列独立滚动，批量文件不撑开页面或图片选择弹窗。 */
.image-upload-queue {max-height:180px;overflow:auto;margin:8px 0;}
.image-upload-row {display:flex;align-items:center;gap:12px;padding:5px 0;font-size:13px;}
.image-upload-row span {flex:1;min-width:0;overflow-wrap:anywhere;}
.image-upload-row progress {width:100px;flex-shrink:0;}
.image-upload-preview {display:flex;gap:8px;overflow:auto;max-height:100px;}
.image-upload-preview img {width:80px;height:80px;object-fit:contain;}
