:root {
  color-scheme: dark;
  --bg: #050812;
  --panel: rgba(12, 18, 32, 0.92);
  --line: rgba(24, 242, 255, 0.22);
  --cyan: #18f2ff;
  --text: #eefcff;
  --muted: #9eb2c2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(24, 242, 255, 0.12), transparent 32rem),
    radial-gradient(circle at 88% 18%, rgba(255, 46, 159, 0.1), transparent 28rem),
    var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}

a { color: var(--cyan); }
img { max-width: 100%; }
.seo-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.seo-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 0; }
.seo-brand { color: var(--text); font-size: 20px; font-weight: 800; letter-spacing: 0.04em; text-decoration: none; }
.seo-nav { display: flex; flex-wrap: wrap; gap: 16px; }
.seo-nav a { color: var(--muted); text-decoration: none; }
.seo-nav a:hover { color: var(--cyan); }

.seo-hero, .seo-card, .seo-prompt-box, .seo-empty {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.seo-hero { padding: clamp(24px, 5vw, 56px); margin: 12px 0 30px; }
.seo-eyebrow { margin: 0 0 8px; color: var(--cyan); font-size: 12px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
h1 { max-width: 900px; margin: 0; font-size: clamp(30px, 6vw, 58px); line-height: 1.15; }
.seo-lead { max-width: 820px; margin: 18px 0 0; color: var(--muted); font-size: 17px; }
.seo-curation-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.seo-curation-stats span { padding: 7px 12px; border: 1px solid rgba(24, 242, 255, 0.2); border-radius: 999px; color: var(--muted); background: rgba(24, 242, 255, 0.045); font-size: 13px; }
.seo-curation-stats strong { margin-right: 4px; color: var(--text); font-size: 15px; }

.seo-library [hidden] { display: none !important; }

.seo-library-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1.8fr) minmax(150px, 0.8fr) minmax(150px, 0.9fr) auto;
  align-items: end;
  gap: 12px;
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(12, 18, 32, 0.76);
}

.seo-library-tools label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.seo-library-tools input,
.seo-library-tools select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid rgba(24, 242, 255, 0.2);
  border-radius: 9px;
  outline: none;
  background: #080d1b;
  font: inherit;
}

.seo-library-tools input:focus,
.seo-library-tools select:focus {
  border-color: rgba(24, 242, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(24, 242, 255, 0.08);
}

.seo-library-reset {
  min-height: 42px;
  padding: 0 14px;
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 9px;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.seo-library-reset:hover { color: var(--text); border-color: rgba(24, 242, 255, 0.36); }
.seo-library-results { display: grid; min-height: 42px; place-items: center; margin: 24px 0 4px; color: var(--muted); font-size: 13px; }
.seo-library-sentinel { width: 1px; height: 1px; }
.seo-library-empty { padding: 34px 18px; color: var(--muted); border: 1px dashed rgba(24, 242, 255, 0.22); border-radius: 14px; text-align: center; }
.seo-breadcrumbs { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.seo-breadcrumbs a { color: var(--muted); }

.seo-grid { columns: 3; column-gap: 18px; }
.seo-card { display: inline-block; width: 100%; margin: 0 0 18px; overflow: hidden; break-inside: avoid; vertical-align: top; }
.seo-card[hidden] { display: none; }
.seo-card img { display: block; width: 100%; height: auto; object-fit: contain; background: #101827; }
.seo-image-placeholder { display: grid; min-height: 220px; place-items: center; color: rgba(24, 242, 255, 0.72); background: linear-gradient(135deg, #101827, #170c22); font-size: 13px; font-weight: 800; letter-spacing: 0.22em; text-decoration: none; }
.seo-card-body { padding: 18px; }
.seo-card h2 { margin: 0 0 8px; font-size: 19px; line-height: 1.35; }
.seo-card h2 a { color: var(--text); text-decoration: none; }
.seo-card p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.seo-meta, .seo-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.seo-meta span, .seo-tags span { padding: 4px 9px; border: 1px solid rgba(24, 242, 255, 0.18); border-radius: 999px; color: var(--muted); font-size: 12px; }
.seo-card-actions { display: grid; grid-template-columns: 1fr 1.15fr; gap: 8px; margin-top: 16px; }
.seo-card-actions .seo-action-button { min-height: 40px; padding: 0 10px; font-size: 13px; }

.seo-prompt-detail-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.4fr);
  align-items: start;
  gap: 20px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.seo-prompt-detail-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(24, 242, 255, 0.1), transparent 24%, transparent 72%, rgba(255, 46, 159, 0.08));
  pointer-events: none;
}

.seo-prompt-detail-card > * { position: relative; z-index: 1; }

.seo-detail-media {
  position: sticky;
  top: 20px;
  width: 100%;
  aspect-ratio: var(--seo-detail-ratio, 3 / 2);
  overflow: hidden;
  border: 1px solid rgba(24, 242, 255, 0.22);
  border-radius: 12px;
  background: #020617;
}

.seo-detail-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020617;
}

.seo-detail-media .seo-image-placeholder { width: 100%; height: 100%; min-height: 0; }

.seo-ratio-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  border: 1px solid rgba(24, 242, 255, 0.3);
  border-radius: 999px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.78);
  font-size: 12px;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.seo-detail-content { display: flex; min-width: 0; flex-direction: column; }
.seo-detail-heading { padding: 2px 2px 16px; border-bottom: 1px solid rgba(24, 242, 255, 0.14); }
.seo-detail-heading h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.18; }
.seo-detail-summary { max-width: 760px; margin: 12px 0 0; color: var(--muted); }

.seo-detail-tags,
.seo-detail-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.seo-detail-tags span,
.seo-detail-keywords span {
  padding: 5px 9px;
  border: 1px solid rgba(24, 242, 255, 0.2);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.46);
  font-size: 12px;
}

.seo-detail-keywords { margin-top: 8px; }
.seo-detail-keywords span { border-color: rgba(182, 255, 59, 0.2); color: #c7ef99; background: rgba(182, 255, 59, 0.05); }

.seo-detail-text-stack { display: grid; gap: 12px; margin-top: 16px; }
.seo-detail-text-block { min-width: 0; padding: 14px; border-radius: 10px; }
.seo-detail-original { border: 1px solid rgba(24, 242, 255, 0.22); background: linear-gradient(135deg, rgba(2, 6, 23, 0.58), rgba(12, 20, 34, 0.36)); box-shadow: inset 0 0 18px rgba(24, 242, 255, 0.04); }
.seo-detail-translation { border: 1px solid rgba(182, 255, 59, 0.22); background: rgba(182, 255, 59, 0.055); }

.seo-detail-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.seo-detail-section-heading strong { color: var(--cyan); font-size: 14px; }
.seo-detail-translation .seo-detail-section-heading strong { color: #b6ff3b; }
.seo-detail-section-heading small { color: var(--muted); font-size: 12px; }

.seo-detail-text-block pre,
.seo-detail-text-block p {
  max-height: 340px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  color: #d9faff;
  background: rgba(2, 6, 23, 0.62);
  font: 13px/1.72 Consolas, "Microsoft YaHei", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-color: rgba(24, 242, 255, 0.46) rgba(15, 23, 42, 0.48);
  scrollbar-width: thin;
}

.seo-detail-translation p { max-height: 280px; color: #e7f6d2; background: rgba(5, 18, 14, 0.5); font-family: inherit; scrollbar-color: rgba(182, 255, 59, 0.46) rgba(15, 23, 42, 0.48); }
.seo-expand-button { margin-top: 10px; padding: 0; color: var(--cyan); border: 0; background: transparent; font: inherit; font-size: 13px; cursor: pointer; }
.seo-expand-button:hover { color: var(--text); }
.seo-detail-text-block.is-expanded pre,
.seo-detail-text-block.is-expanded p { max-height: none; overflow: visible; }

.seo-detail-text-block pre::-webkit-scrollbar,
.seo-detail-text-block p::-webkit-scrollbar { width: 8px; }
.seo-detail-text-block pre::-webkit-scrollbar-track,
.seo-detail-text-block p::-webkit-scrollbar-track { border-radius: 999px; background: rgba(15, 23, 42, 0.48); }
.seo-detail-text-block pre::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(24, 242, 255, 0.46); }
.seo-detail-text-block p::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(182, 255, 59, 0.46); }

.seo-detail-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding-top: 16px; }
.seo-copy-status { min-height: 18px; color: var(--cyan); }
.seo-detail-actions { display: grid; grid-template-columns: minmax(130px, auto) minmax(190px, auto); gap: 10px; }

.seo-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(24, 242, 255, 0.28);
  border-radius: 10px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.72);
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.seo-action-button:hover { transform: translateY(-1px); border-color: rgba(24, 242, 255, 0.56); }
.seo-primary-action { color: #041014; border-color: rgba(24, 242, 255, 0.72); background: linear-gradient(90deg, var(--cyan), #b6ff3b); }
.seo-mobile-action-bar { display: none; }
.seo-related-section { margin-top: 28px; }
.seo-related-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.seo-related-heading h2 { margin: 0; font-size: clamp(22px, 4vw, 32px); }
.seo-related-heading > a { color: var(--muted); font-size: 14px; }
.seo-related-grid { columns: 4; column-gap: 14px; }
.seo-related-card { display: inline-block; width: 100%; margin: 0 0 14px; overflow: hidden; break-inside: avoid; vertical-align: top; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: var(--panel); text-decoration: none; transition: transform 160ms ease, border-color 160ms ease; }
.seo-related-card:hover { border-color: rgba(24, 242, 255, 0.5); transform: translateY(-1px); }
.seo-related-media { display: block; width: 100%; overflow: hidden; border-bottom: 1px solid rgba(24, 242, 255, 0.14); background: #050814; }
.seo-related-media img { display: block; width: 100%; height: auto; }
.seo-related-placeholder { display: grid; min-height: 180px; place-items: center; color: rgba(24, 242, 255, 0.72); font-size: 11px; font-weight: 800; letter-spacing: 0.18em; }
.seo-related-copy { display: grid; gap: 6px; padding: 13px; }
.seo-related-copy strong { overflow: hidden; font-size: 15px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.seo-related-copy > span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.seo-empty { padding: 36px; color: var(--muted); text-align: center; }
.seo-footer { padding: 44px 0; color: var(--muted); font-size: 14px; text-align: center; }

@media (max-width: 820px) {
  .seo-grid { columns: 2; }
  .seo-library-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seo-prompt-detail-card { grid-template-columns: 1fr; }
  .seo-detail-media { position: relative; top: auto; width: min(100%, 620px); justify-self: center; }
  .seo-related-grid { columns: 2; }
}

@media (max-width: 560px) {
  .seo-header { align-items: flex-start; flex-direction: column; }
  .seo-grid { columns: 1; }
  .seo-library-tools { grid-template-columns: 1fr; }
  .seo-library-results { align-items: stretch; flex-direction: column; text-align: center; }
  .seo-prompt-detail-card { padding: 14px; }
  .seo-detail-heading h1 { font-size: 28px; }
  .seo-detail-footer { align-items: stretch; flex-direction: column; }
  .seo-detail-actions { width: 100%; grid-template-columns: 1fr; }
  .seo-card-actions { grid-template-columns: 1fr 1.15fr; }
  .seo-related-heading { align-items: flex-start; flex-direction: column; }
  .seo-mobile-action-bar {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(24, 242, 255, 0.28);
    border-radius: 14px;
    background: rgba(5, 8, 18, 0.92);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.5), 0 0 22px rgba(24, 242, 255, 0.12);
    backdrop-filter: blur(18px);
  }
  .seo-mobile-action-bar .seo-action-button { min-height: 46px; padding: 0 10px; font-size: 13px; }
  body { padding-bottom: 84px; }
}
