/* 拾光墙 (memory wall) — self-contained styles, no Tailwind dependency */
:root {
  --sgw-bg: #0b0705;
  --sgw-gold: #e8b878;
  --sgw-champagne: #fae5be;
  --sgw-cream: #f4ead5;
  --sgw-ink: #2b1e16;
  --sgw-rose: #d98282;
}

.sgw-nav-btn {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: rgba(230, 215, 184, 0.8);
  transition: color 0.2s ease;
}
.sgw-nav-btn:hover { color: #fff; }

.sgw-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.sgw-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sgw-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(232, 184, 120, 0.16), transparent 70%),
    rgba(5, 3, 2, 0.86);
  backdrop-filter: blur(10px);
}

.sgw-panel {
  position: relative;
  width: min(980px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  border: 1px solid rgba(232, 184, 120, 0.28);
  background:
    linear-gradient(180deg, rgba(28, 19, 14, 0.97), rgba(14, 9, 7, 0.99));
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 235, 200, 0.08);
  color: var(--sgw-champagne);
  overflow: hidden;
  transform: translateY(10px) scale(0.985);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.sgw-overlay.is-open .sgw-panel { transform: none; }

.sgw-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 14px;
  border-bottom: 1px solid rgba(232, 184, 120, 0.14);
}
.sgw-title {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--sgw-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sgw-sub {
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(230, 215, 184, 0.62);
  letter-spacing: 0.08em;
}
.sgw-count {
  font-family: "Courier Prime", monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(232, 184, 120, 0.14);
  color: var(--sgw-gold);
  border: 1px solid rgba(232, 184, 120, 0.25);
}
.sgw-close {
  border: 1px solid rgba(232, 184, 120, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: var(--sgw-champagne);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.sgw-close:hover { background: rgba(232, 184, 120, 0.18); }

.sgw-body {
  overflow-y: auto;
  padding: 18px 24px 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 184, 120, 0.35) transparent;
}
.sgw-body::-webkit-scrollbar { width: 8px; }
.sgw-body::-webkit-scrollbar-thumb {
  background: rgba(232, 184, 120, 0.3);
  border-radius: 999px;
}

.sgw-form {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed rgba(232, 184, 120, 0.3);
  background: rgba(255, 240, 214, 0.03);
  margin-bottom: 22px;
}
.sgw-form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sgw-form-row > * { flex: 1 1 180px; min-width: 0; }

.sgw-input,
.sgw-textarea {
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--sgw-cream);
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 9px 12px;
  outline: none;
}
.sgw-input:focus,
.sgw-textarea:focus { border-color: rgba(232, 184, 120, 0.6); }
.sgw-textarea { resize: vertical; min-height: 62px; }
.sgw-input::placeholder,
.sgw-textarea::placeholder { color: rgba(230, 215, 184, 0.35); }

.sgw-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(232, 184, 120, 0.45);
  background: rgba(232, 184, 120, 0.07);
  cursor: pointer;
  font-size: 13px;
  color: var(--sgw-champagne);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.sgw-file:hover { background: rgba(232, 184, 120, 0.14); border-color: rgba(232, 184, 120, 0.7); }
.sgw-file input { display: none; }
.sgw-file-name {
  color: rgba(230, 215, 184, 0.6);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 46%;
}

.sgw-submit {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--sgw-ink);
  background: linear-gradient(140deg, #f7d9a5, var(--sgw-gold) 55%, #c98f4c);
  box-shadow: 0 10px 24px -10px rgba(232, 184, 120, 0.75);
}
.sgw-submit:disabled { opacity: 0.55; cursor: progress; }

.sgw-status {
  font-size: 12px;
  min-height: 16px;
  color: rgba(230, 215, 184, 0.7);
}
.sgw-status.is-error { color: #f0a0a0; }
.sgw-status.is-done { color: #b6d9a0; }

.sgw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.sgw-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(232, 184, 120, 0.18);
  background: linear-gradient(180deg, rgba(38, 26, 19, 0.95), rgba(20, 13, 9, 0.98));
  box-shadow: 0 18px 40px -26px #000;
  display: flex;
  flex-direction: column;
  animation: sgw-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes sgw-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.sgw-media {
  position: relative;
  background: #080605;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.sgw-media img,
.sgw-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sgw-media video { object-fit: contain; }
.sgw-media audio { width: 88%; }
.sgw-media-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(8, 6, 5, 0.85));
  pointer-events: none;
}
.sgw-kind {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: "Courier Prime", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(232, 184, 120, 0.4);
  color: var(--sgw-gold);
}

.sgw-card-body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 5px; }
.sgw-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sgw-cream);
  line-height: 1.35;
}
.sgw-card-msg {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(230, 215, 184, 0.68);
  white-space: pre-wrap;
  word-break: break-word;
}
.sgw-card-meta {
  margin-top: 2px;
  font-family: "Courier Prime", monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: rgba(232, 184, 120, 0.55);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sgw-empty,
.sgw-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 46px 10px;
  color: rgba(230, 215, 184, 0.45);
  font-size: 13px;
  letter-spacing: 0.08em;
}

@media (max-width: 640px) {
  .sgw-panel { max-height: 92vh; border-radius: 20px; }
  .sgw-head, .sgw-body { padding-left: 16px; padding-right: 16px; }
  .sgw-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .sgw-file-name { max-width: 38%; }
}
