:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: rgba(255,255,255,.74);
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0,0,0,.10);
  --line-soft: rgba(0,0,0,.06);
  --accent: #0071e3;
  --accent-soft: rgba(0,113,227,.10);
  --radius: 8px;
  --shadow: 0 12px 34px rgba(0,0,0,.07);
  --shadow-hover: 0 18px 48px rgba(0,0,0,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(circle at 20% 0%, rgba(0,113,227,.08), transparent 28rem),
    radial-gradient(circle at 95% 10%, rgba(52,199,89,.08), transparent 26rem),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.74);
  backdrop-filter: blur(22px);
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #0071e3, #64d2ff);
  color: white;
  box-shadow: 0 8px 22px rgba(0,113,227,.25);
  font-weight: 800;
}
.brand h1 { margin: 0; font-size: 18px; line-height: 1.15; letter-spacing: 0; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.search { display: grid; gap: 7px; margin-bottom: 18px; }
.search input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.9);
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.search input:focus, select:focus {
  border-color: rgba(0,113,227,.45);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: #fff;
}
.group-label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.toolbar-group { margin-bottom: 20px; }
.category-list, .tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.category-list { display: grid; gap: 8px; }
.chip, .category-btn {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.82);
  color: var(--ink);
  padding: 7px 10px;
  min-height: 34px;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.category-btn { display: flex; justify-content: space-between; gap: 10px; align-items: center; text-align: left; }
.category-btn:hover, .chip:hover { background: #fff; border-color: rgba(0,0,0,.18); transform: translateY(-1px); }
.category-btn.active, .chip.active { background: var(--ink); color: white; border-color: var(--ink); }
.category-btn span:last-child { color: inherit; opacity: .62; font-size: 12px; }
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0,0,0,.04);
}
.segmented button { border: 0; border-radius: 6px; background: transparent; padding: 8px; color: var(--muted); }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.main { min-width: 0; padding: 28px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0 0 6px; color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.topbar h2 { margin: 0; font-size: clamp(26px, 3vw, 44px); line-height: 1.05; letter-spacing: 0; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.stat {
  min-width: 94px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: 0 6px 20px rgba(0,0,0,.04);
}
.stat strong { display: block; font-size: 20px; line-height: 1; }
.stat span { color: var(--muted); font-size: 12px; }
.quick-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 18px;
  padding: 16px;
  margin-bottom: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,.04);
}
.results.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.results.list-view { display: grid; gap: 10px; }
.card {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.grid-view .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(0,0,0,.14); }
.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #e8e8ed;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .22s ease; }
.card:hover .thumb img { transform: scale(1.035); }
.thumb-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--ink);
}
.card-body { padding: 13px; display: grid; gap: 9px; }
.card-title { margin: 0; font-size: 16px; line-height: 1.32; letter-spacing: 0; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; border: 1px solid var(--line-soft); border-radius: 999px; padding: 3px 7px; background: #f6f6f7; }
.card-desc {
  margin: 0;
  color: #3f3f46;
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.action-btn {
  border: 0;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  padding: 8px 10px;
  font-weight: 650;
}
.ghost-btn { background: #f2f2f4; color: var(--ink); }
.action-btn:hover { filter: brightness(.96); }
.list-view .card { grid-template-columns: 150px minmax(0, 1fr); }
.list-view .thumb { aspect-ratio: 1 / 1; border-bottom: 0; border-right: 1px solid var(--line-soft); }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 24px 0 8px; }
.pager button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.84);
  padding: 9px 14px;
}
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.detail-dialog {
  width: min(1180px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 24px 80px rgba(0,0,0,.2);
}
.detail-dialog::backdrop { background: rgba(0,0,0,.38); backdrop-filter: blur(6px); }
.dialog-body { position: relative; padding: 18px; max-height: calc(100vh - 34px); overflow: auto; }
.close-btn {
  position: sticky;
  top: 0;
  margin-left: auto;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  font-size: 22px;
}
.detail-head { display: grid; gap: 10px; margin-bottom: 16px; }
.detail-head h2 { margin: 0; font-size: 28px; line-height: 1.18; letter-spacing: 0; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.detail-images { display: grid; gap: 12px; }
.detail-images img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fafafa;
}
.info-list { display: grid; gap: 7px; margin: 0; }
.info-list div { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px; }
.info-list dt { font-weight: 750; color: var(--muted); }
.info-list dd { margin: 0; overflow-wrap: anywhere; }
.prompt-box { display: grid; gap: 8px; margin-top: 16px; }
.prompt-box header { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.prompt-box h3 { margin: 0; font-size: 15px; }
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin: 0;
  padding: 13px;
  background: #f5f5f7;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  line-height: 1.58;
  font-family: "SFMono-Regular", Menlo, Consolas, "PingFang SC", monospace;
  font-size: 12px;
}
.empty {
  padding: 40px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.84);
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .topbar { align-items: start; flex-direction: column; }
  .quick-panel, .detail-grid { grid-template-columns: 1fr; }
  .list-view .card { grid-template-columns: 110px minmax(0, 1fr); }
}


.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.seo-shell { min-height: 100vh; }
.seo-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(20px);
}
.seo-brand { font-weight: 750; color: inherit; text-decoration: none; }
.seo-header nav { display: flex; gap: 18px; }
.seo-header nav a { color: var(--muted); text-decoration: none; }
.seo-header nav a:hover { color: var(--ink); }
.seo-page, .seo-detail-page { max-width: 1180px; margin: 0 auto; padding: 44px 24px 80px; }
.seo-page h1, .seo-detail h1 { margin: 0; font-size: clamp(34px, 5vw, 64px); line-height: 1.04; letter-spacing: 0; }
.seo-copy { color: var(--muted); font-size: 18px; line-height: 1.5; max-width: 760px; }
.seo-category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 28px; }
.category-card-seo {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}
.category-card-seo span { color: var(--muted); }
.category-card-seo strong { font-size: 30px; }
.seo-grid { margin-top: 24px; }
.seo-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 20px;
  align-items: start;
}
.seo-detail-main {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.seo-gallery {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 78px;
}
.seo-gallery img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
@media (max-width: 900px) {
  .seo-detail { grid-template-columns: 1fr; }
  .seo-gallery { position: static; }
}


.promo-slot { margin: 18px 0; }
.seo-promo-slot { max-width: 1180px; margin: 20px auto 0; padding: 0 24px; }
.promo-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(245,245,247,.9));
  box-shadow: 0 12px 34px rgba(0,0,0,.06);
}
.promo-eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}
.promo-card h2 { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: 0; }
.promo-card p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.promo-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.promo-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: var(--radius);
  font-weight: 750;
  text-decoration: none;
}
.promo-btn.primary { background: var(--ink); color: #fff; }
.promo-btn.secondary { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.resource-hero {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 28px;
}
.resource-hero > div:first-child {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.resource-hero h2 { margin: 0 0 10px; font-size: 24px; letter-spacing: 0; }
@media (max-width: 760px) {
  .promo-card, .resource-hero { grid-template-columns: 1fr; }
  .promo-actions { justify-content: flex-start; }
}
