: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; }

/* ===== 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 { font-size: 28px; }
.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; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #4f7cff 0%, #6f5cff 100%);
  color: #fff; padding: 56px 20px; text-align: center;
  border-radius: 0 0 24px 24px; margin-bottom: 28px;
}
.hero h1 { font-size: 32px; margin-bottom: 10px; }
.hero p { opacity: .9; margin-bottom: 22px; }
.search-bar {
  display: flex; max-width: 560px; margin: 0 auto; background: #fff;
  border-radius: 30px; padding: 6px; box-shadow: var(--shadow-lg);
}
.search-bar input {
  flex: 1; border: none; outline: none; padding: 12px 20px;
  font-size: 15px; border-radius: 30px; background: transparent; color: var(--text);
}
.search-bar button {
  background: var(--primary); color: #fff; border: none;
  padding: 0 26px; border-radius: 30px; cursor: pointer; font-size: 15px;
  transition: background .15s;
}
.search-bar button:hover { background: var(--primary-dark); }

/* ===== Layout ===== */
.layout {
  display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start;
}
.sidebar {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); position: sticky; top: 88px;
}
.sidebar-title { font-size: 14px; color: var(--muted); margin-bottom: 10px; padding: 0 8px; }
.cat-list { list-style: none; }
.cat-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; border-radius: 8px; color: var(--text);
  font-size: 14px; transition: background .15s;
}
.cat-list a:hover { background: var(--bg); }
.cat-list a.active { background: rgba(79,124,255,.1); 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: baseline; margin-bottom: 16px;
}
.section-head h2 { font-size: 20px; }
.category-page-head { margin-bottom: 20px; }
.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 Grid ===== */
.software-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.card {
  background: var(--card-bg); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s; display: block; color: var(--text);
}
.card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--text);
}
.card-cover {
  width: 100%; aspect-ratio: 1 / 1;
  background: linear-gradient(135deg,#e8eeff,#f0e8ff);
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.card-cover-fallback {
  height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--primary);
  padding: 8px; text-align: center;
}
.card-body { padding: 14px; }
.card-title { font-size: 16px; margin-bottom: 6px; }
.card-desc {
  font-size: 13px; color: var(--muted); margin: 6px 0 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 38px;
}
.card-meta { font-size: 12px; color: var(--muted); }

.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 ===== */
.admin-layout {
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px;
  align-items: start;
}
.admin-sidebar {
  position: sticky; top: 88px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 14px;
  box-shadow: var(--shadow);
}
.admin-sidebar-title {
  padding: 4px 10px 12px; color: var(--muted); font-size: 13px; font-weight: 600;
}
.admin-menu { display: flex; flex-direction: column; gap: 4px; }
.admin-menu a {
  display: flex; align-items: center; gap: 10px; min-height: 42px;
  padding: 9px 12px; border-radius: 6px; color: var(--text); font-size: 14px;
}
.admin-menu a:hover { background: var(--bg); }
.admin-menu a.active { background: rgba(79,124,255,.1); color: var(--primary); font-weight: 600; }
.admin-menu-icon { width: 18px; font-size: 17px; text-align: center; }
.admin-main { min-width: 0; }
.admin-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.admin-head h1 { font-size: 24px; }
.admin-filter { display:flex; gap:10px; align-items:center; margin-bottom:16px; flex-wrap:wrap; }
.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-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.admin-software-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.admin-software-head h3 { font-size: 17px; }
.admin-software-head h3 a { color: var(--text); }
.admin-software-head h3 a:hover { color: var(--primary); }
.admin-actions { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.admin-table-wrap { overflow-x: auto; }

/* ===== Catalog Admin ===== */
.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.catalog-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  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 - 220px);
}
.catalog-categories .catalog-category-list {
  flex: 1;
  overflow-y: auto;
}
.catalog-category-list {
  list-style: none;
  margin: 0;
  padding: 8px;
}
.catalog-category-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  min-width: 0;
}
.catalog-category-item.active {
  background: rgba(79,124,255,.08);
  border-color: rgba(79,124,255,.25);
}
.catalog-category-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 8px 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;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.catalog-category-count {
  font-size: 12px;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.catalog-item-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  opacity: 0;
  transition: opacity .15s;
  flex-shrink: 0;
}
.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;
}

/* ===== Forms ===== */
.form-wrap {
  max-width: 680px; margin: 0 auto; background: var(--card-bg);
  padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.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:180px; padding:18px 22px; display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); 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; top:10px; left:10px; width:16px; height:16px; accent-color:var(--primary); }
.image-picker-option img { width:100%; height:92px; object-fit:cover; border-radius:5px; background:var(--bg); }
.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-layout { display:grid; grid-template-columns:300px minmax(0,1fr); gap:20px; align-items:start; }
.dictionary-form { margin:0; padding:20px; position:sticky; top:86px; }
.dictionary-form h2 { margin-bottom:18px; font-size:18px; }
.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-selector { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:18px; padding:14px; background:#fff; border-radius:8px; box-shadow:var(--shadow); }
.dictionary-selector select { min-width:180px; padding:9px 12px; border:1px solid var(--border); border-radius:8px; background:#fff; }
.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-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; }

.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) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .admin-layout { grid-template-columns: 1fr; gap: 16px; }
  .admin-sidebar { position: static; padding: 10px; }
  .admin-sidebar-title { display: none; }
  .admin-menu { flex-direction: row; flex-wrap: wrap; }
  .admin-menu a { flex: 1; justify-content: center; }
  .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; }
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-item-actions { opacity: 1; }
}
@media (max-width: 560px) {
  .admin-head { align-items: flex-start; gap: 12px; }
  .admin-head .btn { padding: 8px 12px; }
  .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; }
}
