:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --text: #1f1f1f;
  --muted: #5f6368;
  --line: #e1e5ea;
  --primary: #0b57d0;
  --primary-dark: #0842a0;
  --compose: #c2e7ff;
  --teal: #0b57d0;
  --shadow: 0 8px 28px rgba(60, 64, 67, 0.13);
  font-family:
    "Google Sans",
    Roboto,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}

body {
  background: var(--bg);
}
.brand-mark {
  border-radius: 10px;
  background: linear-gradient(145deg, #4285f4, #0b57d0);
  box-shadow: 0 5px 14px rgba(11, 87, 208, 0.22);
}
input:focus,
select:focus,
textarea:focus {
  border-color: #8ab4f8;
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.11);
}
.button.primary {
  box-shadow: 0 5px 14px rgba(11, 87, 208, 0.18);
}
.app-shell {
  grid-template-columns: 256px minmax(0, 1fr);
}
.sidebar {
  padding: 1.2rem 0.8rem;
  background: var(--bg);
  border-right: 0;
  backdrop-filter: none;
}
.compose {
  width: auto;
  align-self: flex-start;
  margin: 0.25rem 0 1.25rem 0.25rem;
  padding: 1rem 1.35rem;
  border-radius: 16px;
  background: var(--compose) !important;
  color: #001d35 !important;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2) !important;
}
.nav button {
  padding: 0.56rem 1rem;
  border-radius: 0 18px 18px 0;
  color: #444746;
}
.nav button.active {
  background: #d3e3fd;
  color: #001d35;
}
.nav button b {
  background: transparent;
  color: #001d35;
}
.topbar {
  min-height: 84px;
  padding: 1rem 1.5rem;
  border-bottom: 0;
  background: var(--bg);
  backdrop-filter: none;
}
.content {
  padding: 0 1rem 1.5rem 0;
}
.search {
  min-width: min(44vw, 620px);
  border: 0;
  background: #eaf1fb;
}
.search input {
  background: transparent;
}

.gmail-shell {
  min-height: calc(100vh - 102px);
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}
.list-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  border-bottom: 1px solid #edf0f3;
  color: #5f6368;
}
.list-toolbar .spacer {
  flex: 1;
}
.list-toolbar small {
  font-size: 0.72rem;
}
.batch-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.toolbar-action {
  border: 0;
  border-radius: 8px;
  padding: 0.42rem 0.65rem;
  background: transparent;
  color: #3c4043;
  font: inherit;
  cursor: pointer;
}
.toolbar-action:hover {
  background: #eef2f7;
}
.toolbar-action:disabled {
  opacity: 0.5;
  cursor: wait;
}
.trash-icon {
  width: 17px;
  height: 17px;
  display: block;
  fill: currentColor;
  pointer-events: none;
}
.gmail-list {
  width: 100%;
}
.gmail-row {
  display: grid;
  grid-template-columns:
    24px 24px minmax(125px, 155px) minmax(110px, 150px)
    minmax(260px, 1fr) 72px;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 42px;
  padding: 0 1rem;
  border: 0;
  border-bottom: 1px solid #e8eaed;
  background: #f2f6fc;
  color: #202124;
  text-align: left;
  cursor: pointer;
}
.gmail-row:hover {
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 7px rgba(60, 64, 67, 0.24);
}
.gmail-row.unread {
  background: #fff;
  font-weight: 700;
}
.select-box {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid #9aa0a6;
  border-radius: 2px;
  background: transparent;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}
.select-box.checked,
.select-box.partial {
  border-color: #0b57d0;
  background: #0b57d0;
}
.gmail-row.selected {
  background: #dbe9ff;
}
.gmail-row .star {
  width: 24px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9aa0a6;
  font-size: 1.05rem;
  cursor: pointer;
}
.gmail-row .star.active {
  color: #f4b400;
}
.gmail-row .sender,
.gmail-row .recipient,
.gmail-row .mail-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gmail-row .recipient-chip {
  max-width: 100%;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.12rem 0.45rem;
  border-radius: 8px;
  background: #e8f0fe;
  color: #174ea6;
  font-size: 0.68rem;
  vertical-align: middle;
}
.gmail-row .mail-line {
  font-size: 0.82rem;
}
.gmail-row .mail-preview {
  color: #5f6368;
  font-weight: 400;
}
.gmail-row time {
  text-align: right;
  color: #5f6368;
  font-size: 0.7rem;
  font-weight: 500;
}
.gmail-empty {
  min-height: 340px;
  display: grid;
  place-items: center;
  color: #5f6368;
}

.message-page {
  position: relative;
  height: calc(100vh - 102px);
  min-height: calc(100vh - 102px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}
.address-dismiss-layer {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: none;
  background: transparent;
}
.message-page.address-card-open .address-dismiss-layer {
  display: block;
}
.message-page .detail-toolbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid #edf0f3;
}
.message-page .detail-toolbar .icon-button {
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: #3c4043;
  font-size: 1.5rem;
  cursor: pointer;
}
.message-page .detail-toolbar .icon-button:hover {
  background: #f1f3f4;
}
.message-page .detail-toolbar .detail-back {
  font-size: 1.65rem;
}
.toolbar-separator {
  width: 1px;
  height: 24px;
  margin: 0 0.15rem 0 -0.15rem;
  background: #e0e0e0;
}
.toolbar-svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.message-page .detail-toolbar .trash-icon {
  width: 20px;
  height: 20px;
}
.detail-toolbar-star {
  color: #5f6368 !important;
}
.detail-toolbar-star.active {
  color: #f4b400 !important;
}
.message-page .detail-header {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 1.35rem 1rem 0.8rem;
  border: 0;
}
.detail-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-left: 50px;
  margin-bottom: 1.35rem;
}
.message-page .detail-title-row h3 {
  font-size: 1.45rem;
  font-weight: 500;
  margin: 0;
  color: #202124;
}
.mailbox-tag {
  flex: 0 0 auto;
  border-radius: 4px;
  padding: 0.12rem 0.42rem;
  background: #e0e0e0;
  color: #4d5156;
  font-size: 0.68rem;
}
.detail-meta-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.75rem;
}
.detail-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d3e3fd;
  color: #0b57d0;
  font-weight: 700;
}
.detail-correspondents {
  min-width: 0;
  position: relative;
}
.detail-sender-line {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #202124;
  font-size: 0.86rem;
}
.detail-sender-email {
  margin-left: 0.25rem;
  color: #5f6368;
  font-size: 0.76rem;
}
.message-address-details {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.2rem;
  color: #5f6368;
  font-size: 0.73rem;
}
.message-address-details[open] {
  z-index: 10;
}
.message-address-details summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
}
.message-address-details summary::-webkit-details-marker {
  display: none;
}
.address-card {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.45rem);
  left: 0;
  width: min(540px, 72vw);
  padding: 0.9rem 1rem;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  color: #3c4043;
  box-shadow: 0 4px 12px rgba(60, 64, 67, 0.24);
  font-size: 0.78rem;
}
.address-card > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 0.5rem;
  margin: 0.34rem 0;
  overflow-wrap: anywhere;
}
.address-card > div > span:first-child {
  color: #5f6368;
  text-align: right;
}
.detail-meta-row time {
  padding-top: 0.15rem;
  color: #5f6368;
  font-size: 0.7rem;
  white-space: nowrap;
}
.message-page .detail-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem 1rem 1rem 4.15rem;
}
.message-page .attachment-list {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem 1rem 4.15rem;
}
.message-page .mail-frame {
  height: 100%;
  min-height: 320px;
}
.message-footer-actions {
  max-width: none;
  width: 100%;
  flex: 0 0 auto;
  display: flex;
  gap: 0.65rem;
  margin: auto auto 0;
  padding: 0.8rem 1rem 0.9rem 4.15rem;
  border-top: 1px solid #edf0f3;
  background: #fff;
  box-shadow: 0 -1px 3px rgba(60, 64, 67, 0.06);
}
.gmail-action-pill {
  min-width: 104px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.58rem 1rem;
  border: 1px solid #747775;
  border-radius: 999px;
  background: #fff;
  color: #3c4043;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.gmail-action-pill:hover {
  background: #f8fafd;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18);
}
.action-svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}
.compose-quote {
  margin-top: -0.35rem;
  padding: 0 0.15rem 0.25rem 1rem;
  border-left: 1px solid #c7c7c7;
  color: #202124;
  font-weight: 400;
}
.compose-quote-heading {
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.45;
}
.compose-quote-frame {
  width: 100%;
  height: 260px;
  display: block;
  border: 0;
  background: #fff;
}

@media (max-width: 1050px) {
  .gmail-row {
    grid-template-columns:
      20px 20px minmax(115px, 155px) minmax(220px, 1fr)
      60px;
  }
  .gmail-row .recipient {
    display: none;
  }
}
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 78px 1fr;
  }
  .content {
    padding-right: 0.65rem;
  }
  .gmail-row {
    grid-template-columns: 18px 18px minmax(100px, 135px) minmax(180px, 1fr) 54px;
  }
  .message-page .detail-header,
  .message-page .detail-body,
  .message-page .attachment-list,
  .message-footer-actions {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  .detail-title-row {
    padding-left: 50px;
  }
}
@media (max-width: 700px) {
  .detail-title-row {
    padding-left: 0;
  }
  .detail-meta-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }
  .detail-meta-row time {
    display: none;
  }
  .detail-sender-email {
    display: none;
  }
}
@media (max-width: 600px) {
  .topbar {
    padding: 0.75rem;
  }
  .content {
    padding: 0 0.5rem 0.5rem;
  }
  .gmail-row {
    grid-template-columns: 18px 18px 1fr 48px;
    gap: 0.35rem;
    min-height: 58px;
    padding: 0.4rem 0.7rem;
  }
  .gmail-row .sender {
    grid-column: 3;
  }
  .gmail-row .mail-line {
    grid-column: 3 / 5;
  }
  .gmail-row .star {
    grid-column: 2;
    grid-row: 1;
  }
  .gmail-row time {
    grid-column: 4;
    grid-row: 1;
  }
}
