* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: #17212b;
  background: #eef7fb;
}
a { color: #146c94; text-decoration: none; }
.webmail-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 54px 1fr;
  background: #eef7fb;
}
.webmail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid #dce6ed;
  background: #fff;
}
.webmail-bar strong {
  margin-right: 12px;
  color: #1677d2;
}
.webmail-bar span {
  color: #53616d;
}
.webmail-bar nav {
  display: flex;
  gap: 14px;
  white-space: nowrap;
}
.webmail-frame {
  width: 100%;
  height: calc(100vh - 54px);
  border: 0;
  background: #fff;
}
.mail-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
  background: #eef7fb;
}
.mail-sidebar {
  color: #fff;
  background:
    radial-gradient(circle at 28% 18%, rgba(255,255,255,.10), transparent 14%),
    radial-gradient(circle at 70% 34%, rgba(255,255,255,.08), transparent 18%),
    linear-gradient(180deg, #22313c, #172631);
  padding: 14px 10px;
}
.mail-brand {
  padding: 12px 10px 16px;
  color: #b9d7ff;
  font-weight: 800;
  font-size: 18px;
}
.mail-sidebar .compose {
  display: block;
  margin: 0 0 12px;
  padding: 11px 14px;
  border-radius: 3px;
  background: #7db213;
  color: #fff;
  font-weight: 800;
}
.mail-sidebar nav a {
  display: block;
  padding: 11px 14px;
  color: #eef7ff;
  font-weight: 700;
}
.mail-sidebar nav a:hover,
.mail-sidebar nav a.active {
  background: rgba(0,0,0,.24);
}
.mail-main {
  padding: 44px 56px;
  overflow: auto;
}
.mail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.mail-top h1 {
  margin-bottom: 6px;
}
.mail-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.mail-toolbar h1 {
  margin-bottom: 6px;
}
.mail-list-panel,
.message-card,
.compose-form {
  background: #fff;
  border: 1px solid #dce6ed;
  border-radius: 10px;
  padding: 12px;
}
.mail-row {
  display: grid;
  grid-template-columns: minmax(160px, 260px) 1fr 180px;
  gap: 14px;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid #edf2f5;
  color: #17212b;
}
.mail-row:hover {
  background: #f3f8fb;
}
.mail-row:last-child {
  border-bottom: 0;
}
.mail-from,
.mail-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-from {
  font-weight: 800;
}
.mail-date {
  color: #657380;
  font-size: 13px;
  text-align: right;
}
.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: #657380;
}
.compose-form {
  max-width: 920px;
}
.compose-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #cbd8df;
  border-radius: 8px;
  padding: 12px;
  font: inherit;
}
.message-meta {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px 12px;
  margin: 0 0 18px;
}
.message-meta dt {
  color: #657380;
}
.message-meta dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.message-body,
.quoted-original pre {
  white-space: pre-wrap;
  word-break: break-word;
}
.message-body {
  min-height: 220px;
  margin: 0;
  background: #f8fbfd;
  color: #17212b;
}
.quoted-original {
  margin: 14px 0;
}
.shell, .auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}
.auth-shell.split {
  grid-template-columns: minmax(280px, 480px) minmax(320px, 460px);
  gap: 72px;
}
.hero { max-width: 720px; }
.brand {
  font-weight: 800;
  color: #1677d2;
  font-size: 28px;
  margin-bottom: 32px;
}
.brand.small { font-size: 22px; margin-bottom: 12px; }
h1 { font-size: 38px; line-height: 1.15; margin: 0 0 18px; }
h2 { margin: 0 0 22px; }
p { font-size: 17px; line-height: 1.8; }
.actions, .links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.button, button {
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  background: #e8eef3;
  color: #17212b;
  font-weight: 700;
  cursor: pointer;
}
.primary {
  background: #1677d2;
  color: #fff;
}
.full { width: 100%; margin-top: 18px; }
.card {
  width: 100%;
  max-width: 460px;
  background: rgba(255,255,255,.94);
  border: 1px solid #dce6ed;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 18px 42px rgba(16, 44, 64, .10);
}
.card.wide {
  max-width: 452px;
  min-height: 520px;
  padding: 24px;
}
.auth-tabs > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tab-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 4px;
  margin-bottom: 58px;
  border-radius: 8px;
  background: #f1f3f7;
}
.tab-list label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin: 0;
  border-radius: 6px;
  color: #17212b;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.tab-list label + label {
  border-left: 1px solid #dde3ea;
}
#tab-login:checked ~ .tab-list label[for="tab-login"],
#tab-register:checked ~ .tab-list label[for="tab-register"],
#tab-qr:checked ~ .tab-list label[for="tab-qr"] {
  background: #fff;
  box-shadow: 0 3px 9px rgba(28, 45, 60, .14);
}
.tab-panel {
  display: none;
  max-width: 260px;
  margin: 0 auto;
}
#tab-login:checked ~ .login-panel,
#tab-register:checked ~ .register-panel,
#tab-qr:checked ~ .qr-panel {
  display: block;
}
.tab-panel h2 {
  text-align: center;
  margin-bottom: 22px;
}
.qr-placeholder {
  width: 200px;
  height: 200px;
  margin: 10px auto 18px;
  border: 1px solid #dce6ed;
  border-radius: 6px;
  background: #fff;
}
label {
  display: block;
  margin: 14px 0 8px;
  font-size: 14px;
  color: #53616d;
}
input {
  width: 100%;
  height: 44px;
  border: 1px solid #cbd8df;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 16px;
}
.suffix-input {
  display: flex;
  align-items: center;
}
.suffix-input input {
  border-radius: 8px 0 0 8px;
}
.suffix-input span {
  height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #cbd8df;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #f5f8fa;
}
.notice {
  padding: 10px 12px;
  border-radius: 8px;
  background: #e8f4ff;
  font-size: 14px;
}
.notice.error { background: #fff1f1; color: #a72a2a; }
.muted, .muted-link { color: #657380; font-size: 14px; }
.center { text-align: center; }
.qr {
  width: 220px;
  height: 220px;
  margin: 12px auto;
}
.code {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
}
.doc {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 24px;
}
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.actions.compact { margin-top: 0; }
.panel {
  background: #fff;
  border: 1px solid #dce6ed;
  border-radius: 12px;
  padding: 22px;
  margin: 18px 0;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  border-bottom: 1px solid #edf2f5;
  padding: 10px 8px;
  vertical-align: top;
}
pre {
  overflow-x: auto;
  background: #16212b;
  color: #e8f4ff;
  padding: 18px;
  border-radius: 10px;
}
@media (max-width: 820px) {
  .mail-shell { grid-template-columns: 1fr; }
  .mail-sidebar { position: static; }
  .mail-main { padding: 28px 18px; }
  .mail-top { display: block; }
  .auth-shell.split { grid-template-columns: 1fr; gap: 28px; }
  h1 { font-size: 30px; }
  .card.wide { min-height: auto; }
  .tab-list { margin-bottom: 32px; }
  .topbar { display: block; }
  .mail-toolbar { display: block; }
  .mail-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 12px;
  }
  .mail-date { text-align: left; }
}
