:root {
  color-scheme: light;
  --bg: #f3f5f1;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --ink: #17211c;
  --muted: #647067;
  --line: #dbe2d8;
  --primary: #196b69;
  --primary-dark: #0e514f;
  --accent-soft: #fff1eb;
  --danger: #b42b3a;
  --shadow: 0 16px 40px rgba(29, 45, 39, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.client-shell {
  display: grid;
  min-height: 100vh;
  place-items: start center;
  padding: 24px;
}

.inbox-panel {
  width: min(760px, 100%);
  min-height: 560px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.active-hidden {
  display: none !important;
}

.inbox-empty {
  display: grid;
  min-height: 480px;
  place-items: center;
  text-align: center;
}

.inbox-empty h1,
.inbox-header h1 {
  margin: 0;
  font-size: 28px;
}

.inbox-empty p,
.inbox-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.inbox-header,
.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill {
  padding: 8px 10px;
  border-radius: 999px;
  background: #e9f5f4;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.share-url {
  margin: 16px 0 10px;
  padding: 12px;
  border: 1px solid #f2d2c3;
  border-radius: 8px;
  background: var(--accent-soft);
  color: #6d321b;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.notice-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0;
  font-weight: 800;
}

.inbox-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.primary-button,
.small-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
}

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

.small-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.small-button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  opacity: 0.55;
}

.switch,
.compact-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #33423a;
  font-size: 13px;
  font-weight: 700;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #ccd6d0;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: 160ms ease;
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.compact-label select {
  width: 112px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 8px 10px;
}

.history-head {
  margin: 12px 0;
}

.history-head h2 {
  margin: 0;
  font-size: 18px;
}

.history-head span {
  color: var(--muted);
  font-size: 13px;
}

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

.message-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.message-top time {
  color: var(--muted);
  font-size: 12px;
}

.message-item p {
  margin: 10px 0 0;
  line-height: 1.55;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.empty-list {
  display: grid;
  min-height: 130px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 31, 27, 0.42);
}

.modal {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
}

.modal-body {
  padding: 16px;
  color: #33423a;
  line-height: 1.7;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .client-shell {
    padding: 14px;
  }

  .inbox-panel {
    min-height: calc(100vh - 28px);
    padding: 16px;
  }

  .inbox-header,
  .history-head {
    align-items: stretch;
    flex-direction: column;
  }

  .inbox-tools {
    align-items: stretch;
    flex-direction: column;
  }
}
