:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --ink: #1f2329;
  --muted: #8a909c;
  --line: #e8eaed;
  --brand: #ff7a18;
  --brand-soft: #fff1e6;
  --accent: #2f6bff;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 24, 35, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* 广告位 */
.ad-banner, .ad-inline {
  background: repeating-linear-gradient(45deg, #fafafa, #fafafa 12px, #f2f2f2 12px, #f2f2f2 24px);
  border: 1px dashed #d6d9de;
  color: var(--muted);
  text-align: center;
  padding: 14px;
  margin: 14px auto;
  max-width: 1080px;
  border-radius: var(--radius);
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.ad-label {
  background: var(--muted);
  color: #fff;
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 11px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
.header-inner { display: flex; align-items: center; gap: 16px; padding: 12px 18px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 20px; color: var(--brand); text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 14px; }
.nav a { color: var(--ink); text-decoration: none; font-size: 14px; }
.nav a:hover { color: var(--brand); }
.search {
  margin-left: auto;
  flex: 1 1 220px;
  max-width: 320px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  outline: none;
}
.search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* Sections */
.section-title { font-size: 18px; margin: 26px 0 14px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(20, 24, 35, 0.1); }
.card h3 { margin: 0; font-size: 16px; }
.card .desc { font-size: 13px; color: var(--muted); margin: 0; flex: 1; }
.badge {
  align-self: flex-start;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; color: var(--muted); background: #f1f2f4; border-radius: 6px; padding: 1px 7px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* Footer */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 13px; text-align: center; }
.site-footer .muted { font-size: 12px; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 18, 25, 0.55); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 50; }
.modal-card { background: #fff; border-radius: 16px; max-width: 620px; width: 100%; max-height: 86vh; overflow: auto; padding: 24px; position: relative; box-shadow: 0 20px 60px rgba(15, 18, 25, 0.25); color: #1f2329; }
.modal-close { position: absolute; top: 14px; right: 14px; border: none; background: #f1f2f4; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 0; }
.modal-close:hover { background: #e5e6e8; }
#modal-body h3 { margin: 10px 0 6px; font-size: 20px; color: #1f2329; line-height: 1.4; }
#modal-body .muted { color: #5b616d; font-size: 14px; margin: 0 0 10px; line-height: 1.5; }
#modal-body .tags { margin-bottom: 14px; }
.prompt-content {
  background: #f8f9fb;
  color: #111317;
  border: 1px solid #e8eaed;
  padding: 16px;
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.7;
  overflow: auto;
  max-height: 48vh;
  min-height: 80px;
  box-shadow: inset 0 1px 2px rgba(20,24,35,0.04);
}
.modal-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.modal-hint { text-align: center; color: #9ca3af; font-size: 12px; margin: 12px 0 0; }
.btn { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; }
.btn.primary { background: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:active { transform: scale(.97); }
.src { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 99;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }
