:root {
  color-scheme: light;
  --bg: #f7f3ec;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --text: #222222;
  --muted: #706b64;
  --line: #e5ddd0;
  --accent: #d07b44;
  --accent-dark: #a35425;
  --shadow: 0 18px 50px rgba(82, 57, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(208, 123, 68, 0.17), transparent 32rem),
    linear-gradient(135deg, #fbf7ef, var(--bg));
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.site-header {
  text-align: center;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.1rem, 6vw, 4rem);
  letter-spacing: -0.05em;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
}

.daily-card,
.comment-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.daily-card {
  padding: 18px;
}

.date-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 18px;
  text-align: center;
}

.date-row .ghost-button:first-child {
  justify-self: start;
}

.date-row .ghost-button:last-child {
  justify-self: end;
}

.date-label {
  font-size: 1.18rem;
  font-weight: 800;
}

.day-hint {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.ghost-button,
.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.ghost-button {
  background: #f1ebe2;
  color: var(--text);
}

.ghost-button:hover:not(:disabled),
.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.primary-button {
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.image-stage {
  position: relative;
  margin: 0;
  overflow: hidden;
  min-height: 320px;
  border-radius: 24px;
  background: #eee7dc;
  outline: none;
}

.image-stage:focus-visible {
  box-shadow: 0 0 0 4px rgba(208, 123, 68, 0.28);
}

.image-stage img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.image-hit {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 50%;
  border: 0;
  background: transparent;
}

.image-hit-left {
  left: 0;
}

.image-hit-right {
  right: 0;
}

.image-hit:hover {
  background: rgba(0, 0, 0, 0.06);
}

.image-caption {
  margin: 14px 4px 2px;
  color: var(--muted);
  text-align: center;
}

.comment-card {
  margin-top: 24px;
  padding: 24px;
}

.comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.comment-head h2 {
  margin-bottom: 0;
}

.status-text,
#charCount {
  color: var(--muted);
  font-size: 0.92rem;
}

.comment-form {
  display: grid;
  gap: 12px;
}

.role-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.role-picker label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-solid);
  cursor: pointer;
}

.role-picker input {
  accent-color: var(--accent);
}

textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card-solid);
  color: var(--text);
  outline: none;
}

textarea:focus {
  border-color: rgba(208, 123, 68, 0.7);
  box-shadow: 0 0 0 4px rgba(208, 123, 68, 0.14);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comments-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.comment-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card-solid);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.role-badge {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f3d7c4;
  color: var(--accent-dark);
  font-weight: 900;
}

.comment-item p {
  margin: 0;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 20px, 980px);
    padding-top: 28px;
  }

  .date-row {
    grid-template-columns: 1fr;
  }

  .date-row .ghost-button:first-child,
  .date-row .ghost-button:last-child {
    justify-self: stretch;
  }

  .image-stage {
    min-height: 220px;
  }

  .comment-head,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }
}
