:root {
  --sunset-pink: #ff7eb3;
  --sunset-orange: #ff9a56;
  --sunset-purple: #7c6ee8;
  --sunset-blue: #4facfe;
  --ink: #2c2545;
  --ink-soft: #574e73;
  --paper: #ffffff;
  --paper-soft: #fbf9ff;
  --line: #eae5f7;
  --link: #3a63e8;
  --danger: #e8567c;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% -10%, rgba(255, 154, 86, 0.35), transparent 45%),
    radial-gradient(circle at 90% 0%, rgba(79, 172, 254, 0.3), transparent 50%),
    linear-gradient(160deg, #fff1f7 0%, #f2f0ff 45%, #eef6ff 100%);
  background-attachment: fixed;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 18px 80px;
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: relative;
  border-radius: 24px;
  padding: 36px 28px;
  margin-bottom: 28px;
  overflow: hidden;
  background: linear-gradient(120deg, var(--sunset-pink), var(--sunset-orange) 45%, var(--sunset-purple) 80%, var(--sunset-blue));
  background-size: 220% 220%;
  animation: driftGradient 14s ease infinite;
  box-shadow: 0 20px 40px -18px rgba(124, 110, 232, 0.55);
}

@keyframes driftGradient {
  0% { background-position: 0% 40%; }
  50% { background-position: 100% 60%; }
  100% { background-position: 0% 40%; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header { animation: none; }
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 120%, rgba(255,255,255,0.35), transparent 55%);
  pointer-events: none;
}

.site-title {
  margin: 0;
  color: #fff;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 3px 14px rgba(44, 37, 69, 0.25);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.site-title .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.35);
}

.site-tagline {
  margin: 8px 0 0;
  color: rgba(255,255,255,0.92);
  font-size: 0.95rem;
  font-weight: 500;
}

.back-link {
  position: absolute;
  top: 24px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.35);
  transition: background 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
  background: rgba(255,255,255,0.34);
  transform: translateY(-1px);
}

/* ---------- 投稿フォーム ---------- */
.post-form {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 34px;
  box-shadow: 0 14px 34px -20px rgba(87, 78, 115, 0.35);
  border: 1px solid var(--line);
}

.post-form h2 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-form h2::before {
  content: "";
  width: 6px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--sunset-pink), var(--sunset-blue));
  display: inline-block;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 600;
}

.field input[type="text"],
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper-soft);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input[type="text"]:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--sunset-purple);
  box-shadow: 0 0 0 3px rgba(124, 110, 232, 0.15);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

.file-drop {
  border: 1.5px dashed #d7cdf5;
  border-radius: 12px;
  padding: 14px;
  background: var(--paper-soft);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.file-drop input {
  width: 100%;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.file-drop .hint {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #9089ab;
}

.submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.btn-post {
  border: none;
  cursor: pointer;
  padding: 11px 28px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--sunset-pink), var(--sunset-orange));
  box-shadow: 0 10px 22px -10px rgba(255, 126, 179, 0.7);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -10px rgba(255, 126, 179, 0.8);
}

.btn-post:active {
  transform: translateY(0);
}

.error-banner {
  background: #fff0f4;
  border: 1px solid #ffc2d6;
  color: var(--danger);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  margin-bottom: 18px;
  font-weight: 600;
}

/* ---------- 投稿一覧 ---------- */
.posts-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
  padding: 0 4px;
}

.posts-heading h2 {
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-weight: 700;
  margin: 0;
}

.posts-count {
  font-size: 0.8rem;
  color: #9089ab;
  font-weight: 600;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px -20px rgba(87, 78, 115, 0.4);
  position: relative;
}

.post-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--sunset-pink), var(--sunset-purple), var(--sunset-blue));
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-left: 10px;
}

.post-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  background: linear-gradient(135deg, var(--sunset-purple), var(--sunset-blue));
  flex-shrink: 0;
}

.post-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}

.post-time {
  font-size: 0.75rem;
  color: #a099bd;
  margin-left: auto;
  white-space: nowrap;
}

.post-body {
  padding-left: 10px;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ink);
  word-break: break-word;
  white-space: pre-wrap;
}

.post-body a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(58, 99, 232, 0.35);
  text-underline-offset: 2px;
}

.post-body a:hover {
  text-decoration-color: var(--link);
}

.attachments {
  padding-left: 10px;
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.attachment img {
  width: 100%;
  border-radius: 12px;
  display: block;
  border: 1px solid var(--line);
  max-height: 260px;
  object-fit: cover;
}

.attachment video {
  width: 100%;
  border-radius: 12px;
  display: block;
  background: #000;
  max-height: 320px;
}

.attachment.audio {
  grid-column: 1 / -1;
  background: var(--paper-soft);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
}

.attachment audio {
  width: 100%;
}

.post-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-left: 10px;
}

.delete-form button {
  border: none;
  background: none;
  color: #c9c1de;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.delete-form button:hover {
  color: var(--danger);
  background: #fff0f4;
}

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: #a099bd;
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  font-size: 0.9rem;
}

footer.page-footer {
  text-align: center;
  margin-top: 40px;
  font-size: 0.78rem;
  color: #b3abcb;
}

@media (max-width: 480px) {
  .site-header { padding: 28px 20px 24px; }
  .site-title { font-size: 1.6rem; }
  .back-link { position: static; margin-top: 14px; align-self: flex-start; }
  .site-header { display: flex; flex-direction: column; }
  .post-card { padding: 16px; }
}
