:root {
  color-scheme: light;
  --bg: #eef1e8;
  --ink: #17211c;
  --muted: #69746d;
  --card: rgba(255, 253, 244, 0.94);
  --line: #d8d0bd;
  --accent: #e05c34;
  --accent-dark: #8d321f;
  --green: #244b3d;
  --cream: #fff7e8;
  --shadow: 0 24px 80px rgba(36, 44, 34, 0.14);
  font-family: "Gill Sans", "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(224, 92, 52, 0.12) 0 1px, transparent 1px 100%) 0 0 / 28px 28px,
    radial-gradient(circle at 16% 8%, rgba(224, 92, 52, 0.22), transparent 28rem),
    radial-gradient(circle at 86% 18%, rgba(36, 75, 61, 0.18), transparent 30rem),
    linear-gradient(135deg, #f8f2e6 0%, #e8edde 100%);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.hero {
  display: grid;
  max-width: 980px;
  margin-bottom: 26px;
  padding: 8px 0 10px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 850px;
  font-size: clamp(2.4rem, 6.6vw, 5.2rem);
  letter-spacing: -0.08em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.04em;
}

.lede {
  max-width: 780px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.create-panel {
  position: relative;
  overflow: hidden;
  padding: 30px;
  margin-bottom: 22px;
}

.create-panel::after {
  position: absolute;
  inset: auto -80px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(224, 92, 52, 0.12);
  content: "";
}

.panel-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.address-preview {
  min-width: min(100%, 420px);
  padding: 14px 18px;
  border: 1px solid rgba(224, 92, 52, 0.26);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 247, 232, 0.92), rgba(255, 255, 255, 0.68));
}

.address-preview span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.address-preview strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--accent-dark);
  font-size: clamp(1rem, 2.2vw, 1.4rem);
}

.form-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 0.9fr 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 26px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid #cbbba4;
  border-radius: 18px;
  padding: 15px 15px;
  color: var(--ink);
  background: var(--cream);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(198, 83, 47, 0.14);
}

.checkbox-row {
  grid-column: 1 / span 3;
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  color: #fffaf0;
  background: var(--ink);
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.secondary {
  color: #fffaf0;
  background: var(--green);
}

.ghost {
  color: var(--accent-dark);
  background: rgba(198, 83, 47, 0.1);
}

.danger {
  color: #7b1f17;
  background: rgba(123, 31, 23, 0.1);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 22px;
}

.mailbox-panel,
.detail-panel {
  min-height: 560px;
  padding: 24px;
}

.toolbar,
.mailbox-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mailbox-card {
  margin: 22px 0;
  padding: 16px;
  border: 1px dashed #cbbba4;
  border-radius: 22px;
  background: rgba(255, 247, 232, 0.76);
}

.muted,
.mail-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.mail-list {
  display: grid;
  gap: 10px;
}

.mail-row {
  display: grid;
  width: 100%;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 16px;
  color: var(--ink);
  background: var(--cream);
  text-align: left;
}

.mail-row:hover,
.mail-row.active {
  border-color: var(--accent);
  background: #fff3df;
}

.mail-subject {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-detail {
  margin-top: 22px;
  line-height: 1.65;
}

.mail-detail header {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.mail-detail h3 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  line-height: 1.2;
}

.mail-body {
  overflow: auto;
  max-height: 430px;
  padding: 18px;
  border-radius: 20px;
  background: var(--cream);
  white-space: pre-wrap;
}

.message {
  min-height: 1.5em;
  margin: 14px 0 0;
  color: var(--accent-dark);
  font-weight: 700;
}

.empty-state {
  margin: 22px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 24px, 680px);
    padding: 32px 0;
  }

  .form-grid,
  .layout {
    grid-template-columns: 1fr;
  }

  .checkbox-row {
    grid-column: auto;
  }

  .toolbar,
  .mailbox-card,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }
}
