:root {
  --bg: #f8f4ea;
  --bg-accent: #e7f4ec;
  --ink: #1f2937;
  --muted: #4b5563;
  --line: #d6dde5;
  --card: rgba(255, 255, 255, 0.88);
  --primary: #0f766e;
  --primary-deep: #115e59;
  --danger: #b91c1c;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(253, 224, 171, 0.9), transparent 36%),
    radial-gradient(circle at 90% 90%, rgba(190, 242, 211, 0.9), transparent 35%),
    linear-gradient(150deg, var(--bg), var(--bg-accent));
}

.page {
  width: min(960px, 94vw);
  margin: 28px auto 60px;
  display: grid;
  gap: 16px;
}

.hero h1 {
  margin: 0;
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 12px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.field span {
  font-size: 14px;
  color: var(--muted);
}

textarea,
input[type="file"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#submitBtn {
  background: var(--primary);
  color: #fff;
}

#submitBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ghost {
  background: #e5f3ff;
  color: #075985;
}

.status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.status.error {
  color: var(--danger);
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.posts {
  display: grid;
  gap: 10px;
}

.post {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.post-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.post-content {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-images {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.post-images img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  display: block;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.preview-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.preview-item img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  display: block;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  background: #fff;
}

@media (max-width: 640px) {
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  button {
    width: 100%;
  }

  .feed-head {
    flex-direction: column;
    align-items: stretch;
  }
}
