:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef4ff;
  color: #172033;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(0, 120, 212, .18), transparent 34rem),
    linear-gradient(135deg, #f7fbff 0%, #eaf1ff 100%);
}

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

.shell.wide {
  place-items: start center;
}

.card {
  width: min(1180px, 100%);
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(99, 132, 187, .18);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(21, 53, 100, .16);
  padding: 42px;
}

.hero { text-align: center; }

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 8px 14px;
  background: #e7f1ff;
  color: #075cab;
  font-weight: 700;
  font-size: 13px;
}

h1 {
  margin: 18px 0 12px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

p {
  margin: 0;
  color: #5b667a;
  font-size: 18px;
  line-height: 1.7;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 32px 0 18px;
  flex-wrap: wrap;
}

.actions.compact { margin: 0; }

.login-form {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

input, textarea {
  width: 100%;
  border: 1px solid #d8e3f5;
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  background: #fff;
  color: #172033;
}

.login-form input { max-width: 320px; }

.hidden { display: none; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
}

.primary {
  background: #0078d4;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 120, 212, .28);
}

.ghost {
  background: #eef5ff;
  color: #075cab;
}

.note { font-size: 14px; }

.topbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f3f7ff;
  color: #4b5c76;
}

.profile {
  margin-top: 18px;
  font-weight: 700;
}

.mail-layout, .console-layout {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.mail-layout { grid-template-columns: 230px 1fr; }
.console-layout { grid-template-columns: 230px 200px minmax(280px, 1fr) minmax(360px, 1.15fr); }

.accounts-panel, .folders-panel, .messages-panel, .reader-panel {
  min-width: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.accounts, .folders {
  display: grid;
  align-content: start;
  gap: 8px;
}

.account, .folder {
  border: 1px solid #e3ebf8;
  background: #fff;
  color: #24324a;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.account {
  display: grid;
}

.account.active, .folder.active {
  background: #0078d4;
  color: #fff;
  border-color: #0078d4;
}

.account small, .folder small { opacity: .72; }

.empty {
  padding: 14px;
  border-radius: 14px;
  background: #f3f7ff;
  color: #66748a;
}

.send-box {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #e3ebf8;
  border-radius: 18px;
  background: #f8fbff;
  margin-bottom: 18px;
}

.messages {
  display: grid;
  align-content: start;
  gap: 12px;
}

.message {
  padding: 16px;
  border: 1px solid #e3ebf8;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
}

.message.active {
  border-color: #0078d4;
  box-shadow: 0 0 0 3px rgba(0, 120, 212, .12);
}

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

.reader {
  min-height: 520px;
  padding: 16px;
  border: 1px solid #e3ebf8;
  border-radius: 18px;
  background: #fff;
}

.reader.loading {
  color: #66748a;
}

.message-detail h3 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.25;
}

.detail-meta {
  margin: 6px 0;
  color: #4b5c76;
  font-size: 14px;
  line-height: 1.5;
}

.attachment-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff8df;
  color: #7a5200;
}

.message-body {
  width: 100%;
  min-height: 360px;
  margin-top: 18px;
  border: 1px solid #e3ebf8;
  border-radius: 14px;
  background: #fff;
}

.message-body pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.subject {
  font-weight: 800;
  margin-bottom: 6px;
}

.meta, .preview {
  color: #66748a;
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 960px) {
  .console-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .mail-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .card { padding: 26px; border-radius: 22px; }
  .topbar { flex-direction: column; }
  h1 { font-size: 36px; }
}
