:root {
  --paper: #fffdf7;
  --ink: #20251f;
  --muted: #6d746c;
  --line: #dde1d8;
  --green: #285d4c;
  --green-soft: #e1eee7;
  --orange: #dc6a3a;
  --shadow: 0 22px 60px rgba(42, 59, 48, .13);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(220, 106, 58, .11), transparent 27rem),
    radial-gradient(circle at 91% 84%, rgba(40, 93, 76, .13), transparent 31rem),
    #f1efe7;
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button, input, textarea { font: inherit; }

.page {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 52px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.back-link { color: var(--green); font-weight: 750; text-decoration: none; }
.back-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #45a36f; box-shadow: 0 0 0 4px rgba(69, 163, 111, .14); }

.hero {
  position: relative;
  overflow: hidden;
  padding: 44px 46px 48px;
  border-radius: 26px 26px 8px 8px;
  color: #fff;
  background: var(--green);
  box-shadow: var(--shadow);
}

.eyebrow, .section-kicker {
  margin: 0 0 8px;
  color: #bad6c9;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

h1 { position: relative; z-index: 1; margin: 0; font: 800 clamp(36px, 6vw, 58px)/1.08 Georgia, "Microsoft YaHei", serif; letter-spacing: -.03em; }
.intro { position: relative; z-index: 1; max-width: 570px; margin: 14px 0 0; color: #dfebe5; }
.hero-mark { position: absolute; right: 30px; bottom: -58px; color: rgba(255, 255, 255, .075); font: 800 210px/1 Georgia, serif; transform: rotate(-8deg); }

.panel { background: var(--paper); border-radius: 0 0 26px 26px; box-shadow: var(--shadow); }
.composer { display: grid; grid-template-columns: 180px 1fr; gap: 14px; padding: 30px 34px; border-bottom: 1px solid var(--line); }
.field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; letter-spacing: .035em; }

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input { height: 49px; padding: 0 14px; }
textarea { min-height: 118px; padding: 11px 14px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(40, 93, 76, .11); }
.message-field, .form-footer { grid-column: 2; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.counter { color: var(--muted); font-size: 13px; }

#submit-button {
  min-width: 128px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--orange);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(220, 106, 58, .22);
  transition: transform .2s, box-shadow .2s, opacity .2s;
}

#submit-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 11px 22px rgba(220, 106, 58, .28); }
#submit-button:disabled { cursor: wait; opacity: .65; }
.form-notice { grid-column: 1 / -1; min-height: 0; margin: 0; padding: 0; color: #256645; font-size: 14px; }
.form-notice:not(:empty) { min-height: 44px; padding: 10px 14px; border-radius: 9px; background: #e5f3ea; }
.form-notice.error { color: #8a351c; background: #fff0e9; }

.messages { padding: 28px 34px 34px; }
.messages-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-kicker { margin-bottom: 2px; color: #92998f; }
h2 { margin: 0; font: 800 25px/1.3 Georgia, "Microsoft YaHei", serif; }
.refresh-button { border: 0; color: var(--green); background: transparent; font-size: 13px; font-weight: 800; cursor: pointer; }
.refresh-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.refresh-button:disabled { opacity: .45; cursor: wait; }

.message-card { display: grid; grid-template-columns: 46px 1fr; gap: 14px; padding: 20px 0; border-top: 1px solid var(--line); }
.avatar { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px; color: var(--green); background: var(--green-soft); font: 800 18px/1 Georgia, serif; }
.message-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.message-meta time { color: var(--muted); font-size: 12px; }
.message-card p { margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { margin: 12px 0 0; padding: 42px 20px; border: 1px dashed #c5ccbf; border-radius: 14px; color: var(--muted); text-align: center; }
.footer-note { margin: 18px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 640px) {
  .page { width: min(100% - 20px, 920px); padding-top: 18px; }
  .hero { padding: 34px 24px 38px; }
  .hero-mark { right: -20px; }
  .composer { display: block; padding: 24px 20px; }
  .field + .field, .message-field, .form-footer { margin-top: 16px; }
  .form-footer { display: flex; }
  .form-notice:not(:empty) { margin-top: 16px; }
  .messages { padding: 24px 20px 28px; }
  .message-meta { align-items: flex-start; flex-direction: column; gap: 1px; }
}
