body {
  font-family: 'Arial', sans-serif;
  background-color: #f4f5fa;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#authPanel, #registerPanel {
  max-width: 340px;
  margin: 80px auto 30px;
  padding: 32px 32px 18px 32px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,.07);
  text-align: center;
}

#authPanel input, #registerPanel input {
  width: 92%;
  padding: 10px;
  margin: 12px 0 20px 0;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 15px;
  box-sizing: border-box;
}

#authPanel button, #registerPanel button, #logoutBtn {
  background-color: #6a4de2;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  margin-top: 5px;
  margin-bottom: 8px;
}

#authPanel button:hover, #registerPanel button:hover, #logoutBtn:hover {
  background-color: #5b3ed1;
}

#logoutBtn {
  position: fixed;
  top: 25px;
  right: 40px;
  z-index: 99;
  font-size: 14px;
  padding: 6px 14px;
}

.container {
  display: flex;
  height: 100vh;
  padding: 10px;
  gap: 10px;
}

.panel {
  background-color: #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  overflow-y: auto;
}

.left-panel {
  width: 25%;
  display: flex;
  flex-direction: column;
}

.middle-panel {
  width: 35%;
}

.right-panel {
  width: 40%;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.panel-header h3 {
  flex-grow: 1;
  margin: 0;
  font-size: 16px;
}

.panel-header button {
  background-color: #6a4de2;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.panel-header button:hover {
  background-color: #5b3ed1;
}

.email-list {
  flex-grow: 1;
  overflow-y: auto;
}

.email-item {
  padding: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.email-item:hover {
  background-color: #f0f0f0;
}

.email-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 2px;
}

.email-address {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 5px;
}


.delete-btn {
  background: none;
  border: none;
  color: #ff585a;
  font-size: 16px;
  margin-left: 8px;
  cursor: pointer;
  padding: 0 2px;
  margin-top: 0;
  transition: color .12s;
}
.delete-btn:hover {
  background-color: #e33d3f;
}

.mail-time {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}



.mail-content img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
}

.create-email {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
}

.create-email input, .create-email select {
  padding: 5px 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
  flex: 1;
}

.create-email button {
  background-color: #6a4de2;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}

.create-email button:hover {
  background-color: #5b3ed1;
}

.mail-item {
  padding: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 6px;
}

.mail-item:hover {
  background-color: #f5f5f5;
}

.mail-wrapper {
  display: flex;
  flex-direction: column;
}

.mail-subject {
  font-size: 14px;
  margin-bottom: 5px;
}



.mail-detail-header {
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 12px;
  padding-bottom: 4px;
}

.mail-detail-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #2d3e50;
  margin-bottom: 7px;
}

.mail-detail-meta {
  font-size: 0.99rem;
  color: #888;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.mail-detail-body {
  display: flex;
  align-items: flex-start;
  margin-top: 16px;
}

.mail-detail-logo img {
  width: 68px;
  height: 68px;
  margin-right: 18px;
  border-radius: 12px;
  border: 1px solid #ececec;
  background: #fafafa;
}

.mail-detail-content-inner {
  font-size: 1.08rem;
  color: #222;
}

.mail-detail-content-inner p {
  margin: 0 0 10px 0;
}

.mail-detail-empty {
  width: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b0b3b8;
  font-size: 1.08rem;
  letter-spacing: 1px;
}

.mail-detail-logo {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #ececec;
  overflow: hidden;
}

.mail-detail-logo img,
.mail-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* 填充且裁剪，多余部分不变形 */
  border-radius: 12px; /* 保持圆角一致 */
  display: block;
}

.mailbox-card {
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 2px 12px rgba(100,80,200,.08);
  width: 100%;
  max-width: 500px;
  margin: 12px auto 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 390px;
  padding-bottom: 6px;
  overflow: hidden;
}
.mailbox-top, .mailbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 13px 5px 15px;
  border-bottom: 1px solid #f0f0f0;
  gap: 5px;
  background: white;
}
.mailbox-address {
  font-size: 15px;
  font-weight: 600;
  color: #2d2b4f;
  display: flex;
  align-items: center;
  gap: 3px;
  user-select: all;
}
.mailbox-address button, .copy-btn {
  background: #f3f0fc;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  color: #6a4de2;
  padding: 2px 7px;
}
.send-mail-btn, .compose-btn {
  background: #6a4de2;
  color: #fff;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .15s;
  box-shadow: 0 1px 4px rgba(106,77,226,.07);
  margin-left: 6px;
}
.send-mail-btn:hover, .compose-btn:hover { background: #4e36b8; }

.mailbox-tabs {
  display: flex;
  width: 100%;
  border-bottom: 1px solid #eceafd;
  background: #faf9ff;
  margin-top: 0;
}
.tab-btn, .mailbox-tab {
  flex: 1;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 0;
  color: #b2a5d8;
  transition: all .13s;
  cursor: pointer;
  border-radius: 0;
  outline: none;
  letter-spacing: 0.5px;
}
.tab-btn.active, .mailbox-tab.active {
  background: #fff;
  color: #563cd7;
  border-bottom: 2px solid #6a4de2;
  font-weight: 700;
}

.mailbox-list {
  flex: 1;
  min-height: 220px;
  padding: 8px 10px 0 10px;
  overflow-y: auto;
}

.mail-item {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f4f4f7;
  padding: 5px 0;
  cursor: pointer;
  gap: 8px;
  border-radius: 5px;
  transition: background .11s;
}
.mail-item:hover {
  background: #f3f2fa;
}
.mail-info {
  flex: 1;
  min-width: 0;
}
.mail-title {
  font-size: 13px;
  font-weight: 600;
  color: #292860;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-from, .mail-to {
  font-size: 12px;
  color: #9a96b8;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-time {
  font-size: 11px;
  color: #aaa;
  margin-top: 1px;
}

.email-item.selected, .email-item.selected:hover {
  background: #f4f4f8 !important;
}

.mail-item.selected, .mail-item.selected:hover {
  background: #f4f4f8 !important;
  /* border-left: 3px solid #6a4de2; //如要加蓝色竖线也可以 */
}


/*.delete-btn {*/
/*  background: none;*/
/*  border: none;*/
/*  color: #ff585a;*/
/*  font-size: 16px;*/
/*  margin-left: 8px;*/
/*  cursor: pointer;*/
/*  padding: 0 2px;*/
/*  margin-top: 0;*/
/*  transition: color .12s;*/
/*}*/
/*.delete-btn:hover { color: #ff2223; }*/

/* 半透明遮罩层，覆盖全屏 */
.modal-bg {
  position: fixed;
  left: 0; top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(24,24,40,0.26); /* 比较柔和的暗色 */
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}

/* 弹窗内容 */
.modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(40,40,120,0.17);
  width: 370px;           /* 适合大多数屏幕的中等宽度 */
  max-width: 92vw;
  padding: 26px 26px 16px 26px;
  position: relative;
  animation: popup-fadein .18s;
  display: flex;
  flex-direction: column;
}

@keyframes popup-fadein {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* 标题栏与关闭按钮 */
.modal-header {
  font-size: 1.13rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.close-modal {
  font-size: 18px;
  color: #999;
  cursor: pointer;
  margin-left: 10px;
  font-weight: 300;
  transition: color .17s;
}
.close-modal:hover { color: #6a4de2; }

/* 表单内容美化可选 */
.modal-body label {
  font-size: 14px;
  color: #666;
  margin-bottom: 4px;
  display: block;
  margin-top: 8px;
}
.modal-body input, .modal-body textarea, .modal-body select {
  width: 100%;
  margin-bottom: 7px;
  padding: 8px 8px;
  border-radius: 6px;
  border: 1px solid #ececec;
  font-size: 15px;
  resize: none;
  box-sizing: border-box;
}
.modal-body button {
  margin-top: 8px;
  width: 100%;
  padding: 10px 0;
  border-radius: 8px;
  background: #6a4de2;
  color: #fff;
  border: none;
  font-size: 15px;
  cursor: pointer;
  font-weight: 500;
}
.modal-body button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
