/*
 * Careld webmail theme - QQ Mail inspired
 * Plain CSS overrides loaded after the Elastic skin stylesheet.
 */

:root {
  --qq-blue: #1677ff;
  --qq-blue-hover: #0e63e6;
  --qq-blue-soft: #eaf2ff;
  --qq-blue-soft-hover: #dfeaff;
  --qq-bg: #f5f6f7;
  --qq-panel: #ffffff;
  --qq-sidebar: #f7f8fa;
  --qq-border: #ebedf0;
  --qq-border-light: #f2f3f5;
  --qq-text: #1f2329;
  --qq-text-secondary: #5c6370;
  --qq-text-muted: #8f959e;
  --qq-row-hover: #f6f8fb;
  --qq-danger: #f5533d;
}

body,
.popover,
button,
input,
optgroup,
select,
textarea {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

body {
  color: var(--qq-text);
  background-color: var(--qq-bg);
}

a {
  color: var(--qq-blue);
}

a:hover {
  color: var(--qq-blue-hover);
}

/* ---------- Left task rail ---------- */

#layout-menu {
  background-color: var(--qq-panel);
  border-right: 1px solid var(--qq-border);
}

@media screen and (min-width: 481px) {
  #layout-menu .popover-header {
    background-color: var(--qq-panel) !important;
    border-bottom: 1px solid var(--qq-border-light);
  }

  #taskmenu a {
    color: var(--qq-text-secondary);
  }

  #taskmenu a.selected,
  #taskmenu a.selected:hover {
    color: var(--qq-blue);
    background-color: var(--qq-blue-soft);
  }

  #taskmenu a:hover {
    color: var(--qq-blue);
    background-color: #f2f6ff;
  }

  #taskmenu .special-buttons {
    background-color: var(--qq-panel);
    left: 0;
    right: 0;
  }

  #taskmenu .action-buttons a {
    color: var(--qq-blue);
    background: none;
  }

  #taskmenu .action-buttons a:hover {
    color: var(--qq-blue);
    background-color: #f2f6ff;
  }

  #taskmenu a.logout,
  #taskmenu a.logout:hover {
    color: var(--qq-danger) !important;
  }
}

@media screen and (min-width: 1025px) {
  #taskmenu a {
    float: none;
    width: auto;
    height: 54px;
    padding: 6px 0;
    margin: 2px .6rem;
    line-height: 1.25;
    border-radius: 10px;
  }

  #taskmenu .action-buttons a.compose,
  #taskmenu .action-buttons a.compose:hover {
    color: #fff !important;
    background-color: var(--qq-blue);
    box-shadow: 0 6px 14px rgba(22, 119, 255, .28);
  }

  #taskmenu .action-buttons a.compose .inner {
    font-size: 0;
  }

  #taskmenu .action-buttons a.compose .inner::before {
    content: "写信";
    font-size: 12px;
    font-weight: 600;
  }

  #taskmenu .action-buttons a.compose:hover {
    background-color: var(--qq-blue-hover);
  }
}

/* ---------- Folders sidebar ---------- */

#layout-sidebar {
  background-color: var(--qq-sidebar);
  border-right: 1px solid var(--qq-border);
  min-width: 208px;
  max-width: 26%;
}

#layout-sidebar > .header {
  height: 62px;
  min-height: 62px;
  line-height: 62px;
  padding: 0 12px;
  justify-content: flex-start;
  background-color: transparent;
  border-bottom: 0;
}

#layout-sidebar > .header .header-title {
  flex: 1;
  margin: 0;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

#layout-sidebar > .header .username::before {
  content: "\f0e0";
  font-family: Icons;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-right: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5aa2ff, var(--qq-blue));
  color: #fff;
  font-size: 12px;
  line-height: 1;
  vertical-align: middle;
}

#folderlist-content {
  padding: 2px 8px 8px;
}

ul.treelist li > a,
ul.treelist li > div > a {
  line-height: 36px;
  border-radius: 8px;
  color: var(--qq-text-secondary);
}

ul.treelist li > a:hover {
  background-color: #eef1f5;
  color: var(--qq-text);
}

ul.treelist li.selected > a,
ul.treelist li.selected > div > a {
  background-color: var(--qq-blue-soft);
  color: var(--qq-blue);
  font-weight: 600;
}

ul.treelist li.selected > a:hover,
ul.treelist li.selected > div > a:hover {
  background-color: var(--qq-blue-soft-hover);
  color: var(--qq-blue);
}

.folderlist li.mailbox .unreadcount {
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  margin: 9px 8px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--qq-blue);
  font-size: 11px;
  font-weight: 500;
}

#layout-sidebar > .footer {
  background-color: transparent;
  border-top: 0;
}

#layout-sidebar > .footer .quota-widget {
  max-width: 100%;
  padding: 6px 14px;
  font-size: 11px;
  color: var(--qq-text-muted);
}

.quota-widget .bar {
  height: 4px;
  margin: 0 8px;
  background-color: #e9ebee;
  border: 0;
  border-radius: 2px;
}

.quota-widget .value {
  height: 4px;
  background-color: var(--qq-blue);
}

/* ---------- Panels and headers ---------- */

#layout > div > .header {
  height: 58px;
  min-height: 58px;
  line-height: 58px;
  background-color: var(--qq-panel);
  border-bottom: 1px solid var(--qq-border);
}

#layout > div > .footer {
  border-top: 1px solid var(--qq-border);
  background-color: var(--qq-panel);
}

#layout > div > .footer.small {
  height: 36px;
  min-height: 36px;
  line-height: 36px;
}

#layout-list {
  min-width: 320px;
  max-width: 36%;
  border-right: 1px solid var(--qq-border);
}

#layout-list > .header {
  padding: 0 10px;
}

#layout-list > .header a.button,
#layout-content > .header a.button {
  color: var(--qq-text-secondary);
  border-radius: 8px;
}

#layout-list > .header a.button:hover,
#layout-content > .header a.button:hover {
  background-color: var(--qq-border-light);
  color: var(--qq-text);
}

#layout-content {
  background-color: var(--qq-panel);
}

#messagelist-content {
  box-sizing: border-box;
  padding: 2px 8px;
}

/* ---------- Search bar ---------- */

#layout-list > .searchbar {
  height: 36px;
  min-height: 36px;
  line-height: 36px;
  margin: 10px 12px;
  background-color: #f1f3f5;
  border-bottom: 0;
  border-radius: 18px;
}

#layout-list > .searchbar form:before {
  color: var(--qq-text-muted);
}

#mailsearchform {
  font-size: 13px;
}

#layout-list > .searchbar a {
  color: var(--qq-text-muted);
}

#layout-list > .searchbar a.selected {
  color: var(--qq-blue);
}

/* ---------- Message list ---------- */

.messagelist tbody td {
  height: 64px;
  vertical-align: middle;
  border-bottom: 1px solid var(--qq-border-light);
}

.messagelist td.subject {
  padding: 9px 12px 9px 0;
  align-content: center;
}

.messagelist td.subject span {
  line-height: 20px;
}

.messagelist td.subject span.date {
  font-size: 12px;
  color: var(--qq-text-muted);
}

.messagelist td.subject span.fromto {
  flex: 1;
  padding-left: .4em;
  padding-right: .5rem;
  font-size: 13px;
  color: var(--qq-text-secondary);
}

.messagelist td.subject span.subject {
  font-size: 13px;
  color: var(--qq-text-muted);
  padding-bottom: 1px;
}

.messagelist td.subject > span.status {
  order: -1;
  flex: 0 0 1.05rem;
  width: 1.05rem;
  text-align: center;
  margin-right: .15em;
}

.messagelist td.subject span.fromto a,
.messagelist td.subject span.subject a {
  color: inherit;
}

.messagelist td.subject span.msgicon.status:before {
  content: "";
}

.messagelist td.subject span.msgicon.status.unread:before,
.messagelist td.subject span.msgicon.status.unreadchildren:before {
  content: "\f111";
  color: var(--qq-blue);
  font-size: .45rem;
}

.messagelist td.selection input {
  accent-color: var(--qq-blue);
}

.messagelist span.attachment span {
  color: var(--qq-text-muted);
}

.messagelist tbody tr:hover td {
  background-color: var(--qq-row-hover);
}

.messagelist tbody tr.selected td {
  background-color: var(--qq-blue-soft);
}

.messagelist tbody tr.selected:hover td {
  background-color: var(--qq-blue-soft-hover);
}

.messagelist tbody tr.selected td:first-child {
  border-left-color: var(--qq-blue);
}

.messagelist tr.flagged span.size,
.messagelist tr.flagged td,
.messagelist tr.flagged td.subject span.date,
.messagelist tr.flagged td.subject span.fromto,
.messagelist tr.flagged td.subject span.subject a {
  color: inherit;
}

.messagelist span.flagged:before {
  color: #ff9f1a;
}

.messagelist tr.flagged td.subject span.date {
  color: var(--qq-text-muted);
}

.messagelist tr.flagged td.subject span.fromto {
  color: var(--qq-text-secondary);
}

.messagelist tr.flagged td.subject span.subject {
  color: var(--qq-text-muted);
}

.messagelist tr.unread td.subject span.fromto {
  color: var(--qq-text);
  font-weight: 600;
}

.messagelist tr.unread td.subject span.subject {
  color: var(--qq-text);
  font-weight: 700;
}

.messagelist tr.unread td.subject span.date {
  color: var(--qq-text-secondary);
}

.messagelist tr.selected td.subject span.fromto {
  color: var(--qq-text);
}

.messagelist tr.selected td.subject span.subject,
.messagelist tr.selected td.subject span.subject a {
  color: var(--qq-text);
}

.messagelist tr.selected td.subject span.date {
  color: var(--qq-text-secondary);
}

.menu.pagenav {
  background-color: var(--qq-panel);
  color: var(--qq-text-muted);
}

.menu.pagenav input:disabled {
  display: none;
}

.menu.pagenav .pagenav-text {
  color: var(--qq-text-muted);
}

/* ---------- Message view ---------- */

#layout-content .frame-content {
  padding: 20px 24px 32px;
}

#message-header {
  padding: 0 0 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--qq-border);
}

#message-header > .subject {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
}

#message-header > .header img.contactphoto {
  width: 44px;
  height: 44px;
  background: #eef1f5;
}

#message-header .header-summary {
  margin-top: 2px;
  font-size: 13px;
  color: var(--qq-text-secondary);
}

#message-header .header-links a {
  font-size: 12px;
  color: var(--qq-text-muted);
}

#message-header .header-links a:hover {
  color: var(--qq-blue);
}

.message-htmlpart {
  font-size: 14px;
  line-height: 1.75;
  color: var(--qq-text);
}

/* ---------- Controls ---------- */

.btn-primary {
  background-color: var(--qq-blue);
  border-color: var(--qq-blue);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled).active,
.btn-primary:not(:disabled):not(.disabled):active {
  background-color: var(--qq-blue-hover);
  border-color: var(--qq-blue-hover);
}

.btn-primary:focus {
  box-shadow: 0 0 0 .2rem rgba(22, 119, 255, .25);
}

.btn-link {
  color: var(--qq-blue);
}

.form-control:focus {
  border-color: #9cc3ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .15);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--qq-blue);
}

.custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--qq-blue);
  border-color: var(--qq-blue);
}

.custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .15);
}

.menu.toolbar a.selected {
  color: var(--qq-blue);
}

.popover .menu li a:not(.disabled):hover,
.popover .menu .dropbutton a.dropdown:hover {
  background-color: var(--qq-blue);
}

.ui-menu .ui-state-active {
  background-color: var(--qq-blue) !important;
}

.ui-datepicker a.ui-state-active {
  background: var(--qq-blue) !important;
}

.ui-slider .ui-slider-handle.ui-state-active {
  background: var(--qq-blue);
  border-color: var(--qq-blue-hover);
}

.floating-action-buttons a.button {
  background: var(--qq-blue);
  box-shadow: 0 6px 16px rgba(22, 119, 255, .35);
}

/* ---------- Login ---------- */

body.task-login {
  background: linear-gradient(180deg, #eef4ff 0%, var(--qq-bg) 42%);
}

.task-login #layout-content {
  background: transparent;
}

.task-login #logo {
  top: 12vh;
  max-height: 64px;
}

#login-form {
  top: 17vh;
  padding: 26px 24px 16px;
  background: var(--qq-panel);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(31, 35, 41, .08);
}

#login-form .form-control {
  height: 40px;
  border-radius: 8px;
}

#login-form .btn-primary,
#rcmloginsubmit {
  height: 40px;
  border-radius: 8px;
}

.careld-pw-cell {
  position: relative;
}

.careld-pw-cell #rcmloginpwd {
  padding-right: 42px;
}

.careld-pw-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  z-index: 3;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8b9fa7;
  font-family: Icons;
  font-style: normal;
  font-weight: 900;
  font-size: 16px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
}

.careld-pw-toggle::before {
  content: "\f06e";
}

.careld-pw-toggle.is-on::before {
  content: "\f070";
}

.careld-pw-toggle:hover,
.careld-pw-toggle:focus {
  color: var(--qq-blue, #1677ff);
  background: rgba(22, 119, 255, .08);
  outline: none;
}

#login-footer {
  color: var(--qq-text-muted);
  font-size: 12px;
}

#login-footer > div {
  margin-top: 10px;
  padding: 0;
  background: transparent;
}

/* ===== QQ Mail structure: full-width top bar + folder pane + list + reading pane ===== */
#taskmenu .account {
  display: none;
}

@media screen and (min-width: 1025px) {
  body:is(.task-mail:not(.action-compose), .task-settings, .task-addressbook) #layout {
    display: grid;
    grid-template-columns: clamp(200px, 16vw, 232px) clamp(340px, 27vw, 384px) minmax(0, 1fr);
    grid-template-rows: 56px minmax(0, 1fr);
    column-gap: 0;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #layout-menu {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    width: auto;
    height: 56px;
    min-height: 56px;
    padding: 0 14px 0 18px;
    background-color: var(--qq-panel);
    border-right: 0;
    border-bottom: 1px solid var(--qq-border);
    overflow: visible;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #layout-menu .popover-header {
    display: flex;
    align-items: center;
    width: auto;
    height: 56px;
    min-height: 0;
    margin: 0 18px 0 0;
    padding: 0 !important;
    background-color: transparent !important;
    border-bottom: 0;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #layout-menu .popover-header img#logo {
    display: none;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #layout-menu .popover-header:before {
    content: "\f0e0";
    font-family: Icons;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, #5aa2ff, var(--qq-blue));
    color: #fff;
    font-size: 14px;
    line-height: 1;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #layout-menu .popover-header:after {
    content: "Careld 邮箱";
    margin-left: 9px;
    font-size: 16px;
    font-weight: 600;
    color: var(--qq-text);
    white-space: nowrap;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #layout-menu .popover-header a.button {
    display: none !important;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu {
    position: static;
    display: flex;
    align-items: center;
    flex: 1;
    gap: 2px;
    height: 56px;
    margin: 0;
    padding: 0;
    background: transparent;
    overflow: visible;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu > a {
    display: inline-flex;
    float: none;
    align-items: center;
    width: auto;
    height: 34px;
    margin: 0;
    padding: 0 14px;
    border-radius: 8px;
    color: var(--qq-text-secondary);
    font-size: 13px;
    font-weight: 500;
    line-height: 34px;
    background: transparent;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu > a:before {
    float: none;
    display: inline-block;
    width: 1em !important;
    height: 1em !important;
    margin: 0 9px 0 0 !important;
    font-size: 14px;
    line-height: 1;
    color: inherit;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu > a span.inner {
    display: inline;
    padding: 0;
    font-size: 13px;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu > a.selected,
  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu > a.selected:hover {
    color: var(--qq-blue);
    background-color: var(--qq-blue-soft);
    font-weight: 600;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu > a:hover {
    color: var(--qq-blue);
    background-color: #f2f6ff;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu .action-buttons {
    display: none;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu .special-buttons {
    position: static;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    background-color: transparent;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu .special-buttons .account {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 230px;
    height: 34px;
    margin: 0 8px 0 6px;
    padding: 0 12px;
    border-radius: 17px;
    background-color: #f2f3f5;
    color: var(--qq-text);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu .special-buttons .account:before {
    content: "\f007";
    font-family: Icons;
    font-weight: 900;
    font-size: 12px;
    color: var(--qq-text-muted);
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu .special-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--qq-text-secondary);
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu .special-buttons a span.inner {
    display: none;
    padding: 0;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu .special-buttons a:before {
    float: none;
    display: block;
    width: 1em !important;
    height: 1em !important;
    margin: 0 !important;
    font-size: 15px;
    line-height: 1;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu .special-buttons a:hover {
    background-color: var(--qq-border-light);
    color: var(--qq-text);
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu .special-buttons a.logout,
  body:is(.task-mail, .task-settings, .task-addressbook) #taskmenu .special-buttons a.logout:hover {
    color: var(--qq-danger) !important;
  }

  body:is(.task-mail, .task-settings, .task-addressbook) #layout-list > .header a.back-sidebar-button,
  body:is(.task-mail, .task-settings, .task-addressbook) #layout-content > .header a.back-list-button {
    display: none !important;
  }

  body:is(.task-mail:not(.action-compose), .task-settings, .task-addressbook) #layout-sidebar {
    grid-column: 1;
    grid-row: 2;
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 0;
    border-right: 1px solid var(--qq-border);
  }

  body:is(.task-mail:not(.action-compose), .task-settings, .task-addressbook) #layout-list {
    grid-column: 2;
    grid-row: 2;
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 0;
    border-right: 1px solid var(--qq-border);
  }

  body:is(.task-mail:not(.action-compose), .task-settings, .task-addressbook) #layout-content {
    grid-column: 3;
    grid-row: 2;
    min-width: 0;
    min-height: 0;
    background-color: var(--qq-panel);
  }

  body.task-settings #layout-content,
  body.task-addressbook #layout-content {
    grid-column: 2 / -1;
  }

  body:is(.task-mail:not(.action-compose), .task-settings, .task-addressbook) #layout-sidebar > .header {
    height: 32px;
    min-height: 32px;
    padding: 0 10px 0 14px;
    background-color: transparent;
    border-bottom: 0;
  }

  body.task-mail:not(.action-compose) #layout-sidebar > .header {
    justify-content: space-between;
  }

  body.task-mail:not(.action-compose) #layout-sidebar > .header:before {
    content: "文件夹";
    flex: 1;
    font-size: 12px;
    font-weight: 400;
    line-height: 32px;
    color: var(--qq-text-muted);
  }

  body.task-mail:not(.action-compose) #layout-sidebar > .header .header-title.username,
  body.task-mail:not(.action-compose) #layout-sidebar > .header a.back-list-button {
    display: none;
  }

  body:is(.task-mail:not(.action-compose), .task-settings, .task-addressbook) #layout-sidebar > .header a.sidebar-menu {
    width: 28px;
    height: 28px;
    margin: 2px 0;
    padding: 0;
    border-radius: 7px;
    font-size: 13px;
  }

  body.task-mail:not(.action-compose) #layout-sidebar .compose-bar {
    display: block;
    padding: 12px 12px 2px;
  }

  body.task-mail:not(.action-compose) #layout-sidebar .compose-bar a.compose {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    background-color: var(--qq-blue);
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 6px 14px rgba(22, 119, 255, .25);
  }

  body.task-mail:not(.action-compose) #layout-sidebar .compose-bar a.compose:before {
    content: "\f044";
    float: none;
    display: inline-block;
    width: auto;
    height: auto;
    margin: 0 7px 0 0;
    font-size: 14px;
    line-height: 1;
    color: #fff;
  }

  body.task-mail:not(.action-compose) #layout-sidebar .compose-bar a.compose span.inner {
    display: inline;
    padding: 0;
    font-size: 0;
  }

  body.task-mail:not(.action-compose) #layout-sidebar .compose-bar a.compose span.inner:after {
    content: "写信";
    font-size: 14px;
  }

  body.task-mail:not(.action-compose) #layout-sidebar .compose-bar a.compose:hover {
    background-color: var(--qq-blue-hover);
    color: #fff !important;
  }
}

/* compose bar only used on desktop layout */
#layout-sidebar .compose-bar {
  display: none;
}

/* ===== Compose (写信) page: QQ Mail layout ===== */
body.task-mail.action-compose #layout-compose-nav,
body.task-mail.action-compose .compose-actionbar,
body.task-mail.action-compose #compose-contacts-panel {
  display: none;
}

@media screen and (min-width: 1025px) {
  body.task-mail.action-compose #layout {
    display: grid;
    grid-template-columns: clamp(200px, 16vw, 232px) minmax(0, 1fr) clamp(248px, 21vw, 288px);
    grid-template-rows: 56px minmax(0, 1fr);
    column-gap: 0;
  }

  body.task-mail.action-compose #layout-compose-nav {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background-color: var(--qq-sidebar);
    border-right: 1px solid var(--qq-border);
  }

  body.task-mail.action-compose #layout-content {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background-color: var(--qq-panel);
  }

  body.task-mail.action-compose #layout-content > .header {
    display: none;
  }

  body.task-mail.action-compose #layout-sidebar {
    grid-column: 3;
    grid-row: 2;
    display: flex !important;
    flex-direction: column;
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 0;
    background-color: var(--qq-panel);
    border-left: 1px solid var(--qq-border);
    border-right: 0;
  }

  body.task-mail.action-compose #layout-sidebar > .header {
    height: 48px;
    min-height: 48px;
    padding: 0 16px;
    background-color: var(--qq-panel);
    border-bottom: 1px solid var(--qq-border-light);
  }

  body.task-mail.action-compose #layout-sidebar > .header .header-title {
    flex: 1;
    margin: 0;
    text-align: left;
    font-size: 0;
    line-height: 48px;
  }

  body.task-mail.action-compose #layout-sidebar > .header .header-title:after {
    content: "联系人";
    font-size: 14px;
    font-weight: 600;
    color: var(--qq-text);
  }

  body.task-mail.action-compose #layout-sidebar > .header a.back-content-button {
    display: none;
  }

  /* left folder column */
  #layout-compose-nav .compose-bar {
    display: block;
    padding: 14px 12px 4px;
  }

  #layout-compose-nav .compose-bar a.compose {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    background-color: var(--qq-blue);
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 6px 14px rgba(22, 119, 255, .25);
  }

  #layout-compose-nav .compose-bar a.compose:before {
    content: "\f044";
    font-family: Icons;
    font-weight: 900;
    float: none;
    display: inline-block;
    width: auto;
    height: auto;
    margin: 0 7px 0 0;
    font-size: 14px;
    line-height: 1;
    color: #fff;
  }

  #layout-compose-nav .compose-bar a.compose span.inner {
    display: inline;
    padding: 0;
    font-size: 0;
  }

  #layout-compose-nav .compose-bar a.compose span.inner:after {
    content: "写信";
    font-size: 14px;
  }

  #layout-compose-nav .compose-bar a.compose:hover {
    background-color: var(--qq-blue-hover);
    color: #fff !important;
  }

  #layout-compose-nav .compose-nav-title {
    padding: 10px 16px 4px;
    font-size: 12px;
    line-height: 1;
    color: var(--qq-text-muted);
  }

  #layout-compose-nav .scroller {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0 8px 12px;
  }

  #layout-compose-nav ul.treelist li > a {
    line-height: 38px;
  }

  /* top action bar */
  body.task-mail.action-compose .compose-actionbar {
    display: flex;
    flex: none;
    align-items: center;
    gap: 6px;
    height: 56px;
    padding: 0 20px;
    background-color: var(--qq-panel);
    border-bottom: 1px solid var(--qq-border);
  }

  body.task-mail.action-compose .compose-actionbar > a,
  body.task-mail.action-compose .compose-actionbar > button {
    display: inline-flex;
    float: none;
    position: static;
    align-items: center;
    justify-content: center;
    height: 34px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    background-color: #fff;
    color: var(--qq-text-secondary);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: none;
  }

  body.task-mail.action-compose .compose-actionbar > a:before,
  body.task-mail.action-compose .compose-actionbar > button:before {
    font-family: Icons;
    font-weight: 900;
    margin-right: 6px;
    font-size: 13px;
    line-height: 1;
    color: inherit;
  }

  body.task-mail.action-compose .compose-actionbar > a:hover,
  body.task-mail.action-compose .compose-actionbar > button:hover {
    border-color: #9cc3ff;
    background-color: #f5f9ff;
    color: var(--qq-blue);
  }

  body.task-mail.action-compose #compose-action-send {
    padding: 0 24px;
    border-color: var(--qq-blue);
    background-color: var(--qq-blue);
    color: #fff;
    font-weight: 600;
  }

  body.task-mail.action-compose #compose-action-send:hover {
    border-color: var(--qq-blue-hover);
    background-color: var(--qq-blue-hover);
    color: #fff;
  }

  body.task-mail.action-compose .compose-actionbar > [aria-disabled="true"],
  body.task-mail.action-compose .compose-actionbar > [disabled] {
    opacity: .45;
    pointer-events: none;
  }

  body.task-mail.action-compose .compose-action-sep {
    width: 1px;
    height: 20px;
    margin: 0 2px;
    background-color: #e6e9ee;
  }

  body.task-mail.action-compose .compose-action-spacer {
    flex: 1;
  }

  body.task-mail.action-compose #compose-action-send:before { content: "\f1d8"; }
  body.task-mail.action-compose #compose-action-savedraft:before { content: "\f0c7"; }
  body.task-mail.action-compose #compose-action-attach:before { content: "\f0c6"; }
  body.task-mail.action-compose #compose-action-signature:before { content: "\f044"; }
  body.task-mail.action-compose #compose-action-responses:before { content: "\f086"; }
  body.task-mail.action-compose #compose-action-spell:before { content: "\f00c"; }
  body.task-mail.action-compose .compose-action-btn.options:before { content: "\f013"; }

  /* headers + body */
  body.task-mail.action-compose #compose-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background-color: var(--qq-panel);
  }

  body.task-mail.action-compose #compose-content > form.formcontent {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: auto;
  }

  body.task-mail.action-compose #compose-content > .formbuttons {
    display: none;
  }

  body.task-mail.action-compose #compose-headers {
    flex: none;
    padding: 2px 0 0;
  }

  body.task-mail.action-compose .compose-headers .form-group.row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    margin: 0;
    padding: 0 24px;
    border-bottom: 1px solid var(--qq-border-light);
  }

  body.task-mail.action-compose .compose-headers .col-form-label {
    flex: 0 0 64px;
    width: 64px;
    max-width: 64px;
    margin: 0;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 20px;
    color: var(--qq-text-muted);
    text-align: left;
  }

  body.task-mail.action-compose .compose-headers .col-10 {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0;
  }

  body.task-mail.action-compose .compose-headers .input-group {
    display: flex;
    align-items: center;
    border: 0;
    background: transparent;
  }

  body.task-mail.action-compose .compose-headers .input-group .form-control,
  body.task-mail.action-compose .compose-headers .form-group > .col-10 > .form-control {
    min-height: 34px;
    height: auto;
    padding: 6px 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 14px;
    color: var(--qq-text);
  }

  body.task-mail.action-compose .compose-headers .input-group-text {
    border: 0;
    background: transparent;
    color: var(--qq-text-muted);
  }

  body.task-mail.action-compose #compose_to .compose-line {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  body.task-mail.action-compose #compose_to .compose-line > .input-group {
    flex: 1;
    min-width: 0;
  }

  body.task-mail.action-compose .compose-ccbcc {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-left: 4px;
    font-size: 13px;
    white-space: nowrap;
  }

  body.task-mail.action-compose .compose-ccbcc a {
    color: var(--qq-text-muted);
  }

  body.task-mail.action-compose .compose-ccbcc a:hover {
    color: var(--qq-blue);
  }

  body.task-mail.action-compose #composebodycontainer {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 320px;
    margin: 0;
    padding: 0;
  }

  body.task-mail.action-compose .tox-tinymce {
    flex: 1;
    min-height: 320px;
    height: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  body.task-mail.action-compose .tox .tox-editor-header {
    padding: 2px 6px;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--qq-border-light);
    box-shadow: none;
  }

  body.task-mail.action-compose .tox .tox-toolbar-overlord {
    background: transparent;
  }

  body.task-mail.action-compose .tox .tox-toolbar__group {
    padding: 0 6px;
    border: 0;
  }

  body.task-mail.action-compose .tox .tox-tbtn {
    width: 30px;
    height: 30px;
    margin: 2px 1px;
    border-radius: 6px;
    color: var(--qq-text-secondary);
  }

  body.task-mail.action-compose .tox .tox-tbtn:hover {
    background-color: var(--qq-blue-soft);
    color: var(--qq-blue);
  }

  body.task-mail.action-compose .tox .tox-tbtn--enabled,
  body.task-mail.action-compose .tox .tox-tbtn--active {
    background-color: var(--qq-blue-soft);
    color: var(--qq-blue);
  }

  body.task-mail.action-compose .tox .tox-edit-area {
    border: 0;
  }

  body.task-mail.action-compose .tox .tox-edit-area__iframe {
    background-color: #fff;
  }

  body.task-mail.action-compose .tox .tox-statusbar {
    display: none;
  }

  /* contacts and extra options */
  body.task-mail.action-compose #compose-contacts-panel {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  body.task-mail.action-compose #compose-contacts-panel #recipient-dialog {
    position: static;
    display: flex;
    flex: 1;
    flex-direction: column;
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  body.task-mail.action-compose #compose-contacts-panel #recipient-dialog > .listbox {
    display: flex;
    flex: 1;
    flex-direction: column;
    height: auto;
    min-height: 0;
    background: transparent;
  }

  body.task-mail.action-compose #compose-contacts-panel .searchbar {
    flex: none;
    height: 36px;
    min-height: 36px;
    margin: 12px 12px 8px;
    padding: 0 14px;
    border: 0;
    border-radius: 18px;
    background-color: #f2f3f5;
  }

  body.task-mail.action-compose #compose-contacts-panel .searchbar form {
    display: flex;
    align-items: center;
    height: 100%;
  }

  body.task-mail.action-compose #compose-contacts-panel .searchbar form:before {
    color: var(--qq-text-muted);
  }

  body.task-mail.action-compose #compose-contacts-panel #searchform {
    flex: 1;
    height: 100%;
    padding: 0 6px 0 22px;
    border: 0;
    background: transparent;
    font-size: 13px;
  }

  body.task-mail.action-compose #compose-contacts-panel .searchbar a.button {
    display: none;
  }

  body.task-mail.action-compose #compose-contacts-panel #recipient-dialog .scroller {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0 8px;
  }

  body.task-mail.action-compose #compose-contacts-panel #directorylist {
    margin: 0;
    padding: 2px 4px 6px;
  }

  body.task-mail.action-compose #compose-contacts-panel #directorylist li > a {
    line-height: 32px;
    font-size: 13px;
    color: var(--qq-text-secondary);
    border-radius: 8px;
  }

  body.task-mail.action-compose #compose-contacts-panel #directorylist li > a:hover {
    background-color: #f3f5f8;
  }

  body.task-mail.action-compose #compose-contacts-panel #directorylist li.active > a {
    background-color: var(--qq-blue-soft);
    color: var(--qq-blue);
  }

  body.task-mail.action-compose #compose-contacts-panel #contacts-table {
    width: 100%;
  }

  body.task-mail.action-compose #compose-contacts-panel #contacts-table td {
    padding: 8px 10px;
    border-bottom: 0;
    border-radius: 8px;
    font-size: 13px;
    color: var(--qq-text);
    cursor: pointer;
  }

  body.task-mail.action-compose #compose-contacts-panel #contacts-table tr:hover td {
    background-color: #f6f8fb;
  }

  body.task-mail.action-compose #compose-contacts-panel #contacts-table tr.selected td {
    background-color: var(--qq-blue-soft);
  }

  body.task-mail.action-compose #compose-contacts-panel #recipient-dialog .pagenav {
    flex: none;
    height: 32px;
    min-height: 32px;
    border-top: 1px solid var(--qq-border-light);
  }

  body.task-mail.action-compose #compose-contacts-panel .compose-contacts-empty {
    padding: 18px 16px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--qq-text-muted);
  }

  body.task-mail.action-compose .compose-side-extra {
    flex: none;
    max-height: 46%;
    overflow: auto;
    padding: 12px 14px 16px;
    background-color: #fafbfc;
    border-top: 1px solid var(--qq-border-light);
  }

  body.task-mail.action-compose .compose-side-extra #compose-attachments.file-upload {
    margin: 0 0 10px;
    padding: 10px 12px !important;
    border: 1px dashed #d4dbde;
    border-radius: 8px;
  }

  body.task-mail.action-compose .compose-side-extra #compose-attachments.file-upload:after {
    display: none;
  }

  body.task-mail.action-compose .compose-side-extra #compose-attachments .upload-form {
    margin: 0;
    padding: 0;
  }

  body.task-mail.action-compose .compose-side-extra #compose-attachments .upload-form .hint {
    margin: 0;
    font-size: 12px;
    color: var(--qq-text-muted);
    text-align: left;
  }

  body.task-mail.action-compose .compose-side-extra #compose-attachments button.attach {
    display: none;
  }

  body.task-mail.action-compose .compose-options-details > summary {
    padding: 6px 0;
    font-size: 13px;
    color: var(--qq-text-secondary);
    cursor: pointer;
    outline: none;
  }

  body.task-mail.action-compose .compose-options-details[open] > summary {
    color: var(--qq-text);
  }

  body.task-mail.action-compose .compose-options-details #compose-options {
    padding: 6px 0 0;
  }

  body.task-mail.action-compose .compose-options-details .form-group {
    margin: 0 0 6px;
  }

  body.task-mail.action-compose .compose-options-details .col-form-label {
    padding: 4px 0;
    font-size: 12px;
    color: var(--qq-text-secondary);
  }

  body.task-mail.action-compose .compose-options-details .col-6 {
    max-width: 50%;
    padding-left: 0;
  }
}

@media screen and (min-width: 1025px) and (max-width: 1279px) {
  body.task-mail.action-compose #compose-action-spell {
    display: none;
  }

  body.task-mail.action-compose .compose-actionbar {
    gap: 4px;
    padding: 0 14px;
  }

  body.task-mail.action-compose .compose-actionbar > a,
  body.task-mail.action-compose .compose-actionbar > button {
    padding: 0 10px;
  }

  body.task-mail.action-compose #compose-action-send {
    padding: 0 18px;
  }
}
