:root {
  --bg: #10121a;
  --surface: #161927;
  --surface-alt: #1e2235;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f7f7fb;
  --muted: rgba(247, 247, 251, 0.7);
  --primary: #5d7bff;
  --primary-hover: #4a62e6;
  --accent: #f7b801;
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow: 0 32px 60px rgba(7, 10, 21, 0.45);
  font-size: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at top, rgba(93, 123, 255, 0.22), transparent 55%),
    radial-gradient(circle at bottom, rgba(247, 184, 1, 0.18), transparent 45%),
    var(--bg);
  color: var(--text);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4vh 5vw 8vh;
}

.site-header {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
}

.header-inner {
  width: min(1180px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 700;
  color: #fff;
  font-size: 1.2rem;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 10px 25px rgba(93, 123, 255, 0.35);
}

.brand-name {
  font-size: 1.2rem;
}

.header-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
}

img {
  max-width: 100%;
  display: block;
}

.page-layout {
  width: min(1180px, 100%);
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  align-items: start;
}

.tags-panel {
  background: linear-gradient(160deg, rgba(22, 25, 39, 0.85), rgba(22, 25, 39, 0.6));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 240px;
  justify-self: start;
  position: sticky;
  top: calc(6vh + 1rem);
  align-self: start;
}

.tags-heading {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tag-item {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.tag-item:hover {
  color: var(--text);
  transform: translateX(6px);
}

.tag-item.is-active {
  background: linear-gradient(135deg, rgba(93, 123, 255, 0.3), rgba(93, 123, 255, 0.12));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(93, 123, 255, 0.5);
  transform: translateX(6px);
}

.prompt-panel {
  background: linear-gradient(145deg, rgba(30, 34, 53, 0.95), rgba(22, 25, 39, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.prompt-panel-header {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.prompt-panel-label {
  align-self: flex-start;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(93, 123, 255, 0.14);
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prompt-panel-title {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
}

.prompt-grid {
  display: grid;
  gap: 1.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.prompt-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.9rem;
  background: linear-gradient(160deg, rgba(30, 34, 53, 0.95), rgba(30, 34, 53, 0.65));
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 22px 60px rgba(7, 10, 21, 0.5);
}

.prompt-card-figure {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, rgba(93, 123, 255, 0.22), rgba(93, 123, 255, 0.05));
}

.prompt-card-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prompt-card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.prompt-card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.prompt-card-meta {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.prompt-card-box {
  background: var(--surface-alt);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  box-shadow: inset 0 0 0 1px rgba(93, 123, 255, 0.12);
  max-height: 240px;
  overflow: auto;
}

.prompt-card-box pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
  font-family: "Menlo", "SFMono-Regular", Consolas, monospace;
  color: var(--muted);
}

.prompt-card-actions {
  display: grid;
  grid-template-columns: 4fr 1fr;
  gap: 0.6rem;
}

.prompt-card-actions .btn {
  width: 100%;
  justify-content: center;
}

.prompt-card-actions .btn-primary {
  font-size: 1.05rem;
  line-height: 1.4;
  padding: 1.1rem 1.4rem;
  white-space: pre-wrap;
}

.prompt-card-actions .btn-secondary {
  font-size: 0.9rem;
  padding: 0.85rem 1rem;
}

.scroll-sentinel {
  width: 100%;
  height: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7f95ff);
  color: #fff;
  box-shadow: 0 18px 30px rgba(93, 123, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 45px rgba(93, 123, 255, 0.48);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  background: rgba(30, 34, 53, 0.95);
  color: var(--text);
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(93, 123, 255, 0.35);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 18px 45px rgba(7, 10, 21, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1200px) {
  .prompt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .prompt-grid {
    grid-template-columns: 1fr;
  }

  .prompt-card-actions {
    grid-template-columns: 1fr;
  }

  .prompt-card-actions .btn-primary {
    font-size: 1rem;
    padding: 0.95rem 1.2rem;
  }
}

@media (max-width: 960px) {
  body {
    padding: 6vh 4vw;
  }

  .page-layout {
    grid-template-columns: 1fr;
  }

  .tags-panel {
    position: static;
    max-width: none;
  }
}

@media (max-width: 560px) {
  body {
    padding: 6vh 5vw;
  }

  .tags-panel,
  .prompt-panel {
    padding: 1.9rem;
  }

  .prompt-panel-title {
    font-size: 1.5rem;
  }

  .prompt-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

