* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #f4f6f9;
  color: #1f2937;
  line-height: 1.6;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

.topbar {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  padding: 18px 0;
  margin-bottom: 20px;
}
.topbar h1 { font-size: 22px; }
.topbar .src { font-size: 12px; opacity: .8; margin-left: 10px; }

.searchbar { display: flex; gap: 8px; margin-bottom: 14px; }
.searchbar input {
  flex: 1; padding: 10px 14px; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 15px; outline: none;
}
.searchbar input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.searchbar button {
  padding: 10px 22px; background: #2563eb; color: #fff;
  border: none; border-radius: 8px; font-size: 15px; cursor: pointer;
}
.searchbar button:hover { background: #1d4ed8; }

.tabs { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs a {
  padding: 6px 14px; border-radius: 999px; text-decoration: none;
  color: #374151; background: #e5e7eb; font-size: 14px;
}
.tabs a.on { background: #2563eb; color: #fff; }
.tabs .spacer { flex: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tags a {
  padding: 3px 10px; border-radius: 999px; background: #eef2ff;
  color: #4338ca; text-decoration: none; font-size: 12px;
}
.tags a i { font-style: normal; color: #818cf8; margin-left: 3px; }
.tags a.on { background: #4338ca; color: #fff; }
.tags a.clear { background: #fee2e2; color: #b91c1c; }

.card {
  background: #fff; border-radius: 12px; padding: 16px 18px;
  margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border: 1px solid #eef0f3;
}
.card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.badge {
  font-size: 12px; padding: 2px 10px; border-radius: 999px; color: #fff;
  flex-shrink: 0; align-self: flex-start;
}
.b-exp { background: #059669; }
.b-dis { background: #7c3aed; }
.title { font-size: 17px; flex: 1; min-width: 200px; word-break: break-all; }
.meta { font-size: 12px; color: #6b7280; }
.meta .author { color: #2563eb; margin-right: 10px; }
.meta .id { font-family: Consolas, monospace; }

.card-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.card-tags a {
  font-size: 12px; color: #6d28d9; background: #f5f3ff;
  padding: 1px 8px; border-radius: 6px; text-decoration: none;
}
.card-tags a:hover { background: #ede9fe; }

.summary {
  margin-top: 8px; font-size: 14px; color: #4b5563;
  background: #f9fafb; border-radius: 8px; padding: 8px 12px;
  word-break: break-all; max-height: 72px; overflow: hidden;
}

.stats { margin-top: 10px; font-size: 12px; color: #9ca3af; }
.stats .date { float: right; }

.links { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 7px 16px; border-radius: 8px;
  font-size: 13px; text-decoration: none; border: none; cursor: pointer;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn-web { background: #dbeafe; color: #1d4ed8; }
.btn-app { background: #dcfce7; color: #15803d; }
.btn-code { background: #ede9fe; color: #6d28d9; }
.btn-preview { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }

.empty {
  text-align: center; padding: 60px 20px; color: #9ca3af;
  background: #fff; border-radius: 12px; border: 1px dashed #d1d5db;
}
.empty code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 20px 0; }
.pager a {
  padding: 6px 14px; background: #2563eb; color: #fff;
  border-radius: 8px; text-decoration: none; font-size: 14px;
}
.pager span { color: #6b7280; font-size: 14px; }

.foot { text-align: center; color: #9ca3af; font-size: 12px; padding: 20px 0 40px; }

/* 在线预览弹窗 */
.modal-mask {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.55);
  z-index: 100; padding: 30px 16px; overflow-y: auto;
}
.modal-mask.show { display: block; }
.modal {
  max-width: 720px; margin: 0 auto; background: #fff; border-radius: 14px;
  padding: 20px 24px; box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.modal-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.modal-head h2 { font-size: 19px; flex: 1; word-break: break-all; }
.modal-close {
  background: #f3f4f6; border: none; border-radius: 8px; width: 30px; height: 30px;
  font-size: 14px; cursor: pointer; color: #6b7280; flex-shrink: 0;
}
.modal-meta { font-size: 13px; color: #6b7280; margin-bottom: 8px; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.modal-tags a {
  font-size: 12px; color: #6d28d9; background: #f5f3ff;
  padding: 1px 8px; border-radius: 6px; text-decoration: none;
}
.modal-stats { font-size: 12px; color: #9ca3af; margin-bottom: 10px; }
.modal-desc {
  background: #f9fafb; border-radius: 8px; padding: 12px 14px;
  font-size: 14px; color: #374151; max-height: 340px; overflow-y: auto;
  line-height: 1.7; word-break: break-all;
}
.modal-desc a.plink { color: #2563eb; text-decoration: underline; }
.pv-loading, .pv-error { text-align: center; color: #9ca3af; padding: 20px; }
.pv-error { color: #b91c1c; }
.modal-model { margin-top: 10px; font-size: 12px; color: #6b7280; background: #eef2ff; padding: 6px 12px; border-radius: 8px; }
.modal-links { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pv-src { font-size: 12px; color: #9ca3af; }
