/* Gamsmail sign-in + inbox. Plain CSS port of the old Vue/naive-ui pages (Login, layout, Home/inbox). */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --primary: #00cf76;
  --primary-soft: rgba(0, 207, 118, 0.05);
  --ink: #2e3033;
  --menu-ink: #333639;
  --faint: #939aa3;
  --line: #e1e3e5;
  --header-height: 88px;
}

html,
body {
  height: 100%;
  margin: 0;
  scrollbar-width: thin;
}

body {
  font-family: v-sans, system-ui, -apple-system, 'system-ui', 'Segoe UI', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  font-size: 14px;
  line-height: 1.5;
  color: var(--menu-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100%;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background-color: #d8d8d8;
}

h1,
h2,
p {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.boot {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--faint);
}

/* icons are masks so they take the text colour */
.ico {
  display: inline-block;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}

.ico-fold { --ico: url('/assets/img/icon-fold.svg'); width: 18px; height: 18px; }
.ico-unfold { --ico: url('/assets/img/icon-unfold.svg'); width: 18px; height: 18px; }
.ico-reload { --ico: url('/assets/img/icon-reload.svg'); width: 18px; height: 18px; }
.ico-fullscreen { --ico: url('/assets/img/icon-fullscreen.svg'); width: 18px; height: 18px; }
.ico-search { --ico: url('/assets/img/icon-search.svg'); width: 20px; height: 20px; }
.ico-back { --ico: url('/assets/img/icon-back.svg'); width: 14px; height: 14px; }
.ico-mail { --ico: url('/assets/img/email.svg'); width: 20px; height: 20px; }
.ico-empty { --ico: url('/assets/img/icon-empty.svg'); width: 40px; height: 40px; }

/* error / info notice */
.notice {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #f5c6c6;
  border-radius: 8px;
  background: #fff4f4;
  color: #b3261e;
  font-size: 14px;
  line-height: 20px;
}

/* ── sign-in ── */
.login {
  width: 100%;
  min-height: 100vh;
  background: #f0f4f9;
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.login-card {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
}

.login-logo {
  display: inline-block;
  cursor: pointer;
}

.login-logo img {
  height: 32px;
}

.login-body {
  display: flex;
  justify-content: space-between;
  margin: 32px 0 0;
}

.login-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-title {
  font-size: 40px;
  font-weight: normal;
  line-height: 48px;
  color: var(--ink);
}

.language {
  display: flex;
  width: fit-content;
  padding: 8px 16px;
  border-radius: 20px;
}

.language img {
  width: 18px;
  height: 18px;
}

.language span {
  margin: 0 0 0 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  color: var(--ink);
}

.login-wrapper {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.login-wrapper .notice {
  width: 412px;
  margin: 0 24px;
}

.provider {
  min-width: 460px;
  display: flex;
  align-items: center;
  padding: 24px;
  cursor: pointer;
}

.provider:hover {
  background: #f2f7ff;
}

.provider-icon {
  width: 64px;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.provider-icon img {
  width: 32px;
  height: 32px;
}

.provider-text {
  margin: 0 0 0 32px;
  font-size: 16px;
  font-weight: bold;
  line-height: 20px;
  color: var(--ink);
}

.login-footer {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  gap: 24px;
}

.login-footer-mobile {
  display: none;
}

@media screen and (max-width: 900px) {
  .login {
    justify-content: space-between;
    background: #fff;
  }

  .login-card {
    border-radius: 0;
    padding: 20px;
  }

  .login-logo {
    margin: 12px 20px 0;
  }

  .login-body {
    flex-direction: column;
    margin: 16px 0 0;
  }

  .login-title {
    font-size: 28px;
    margin: 0 20px 16px;
  }

  .login-left .language {
    display: none;
  }

  .login-wrapper {
    gap: 0;
  }

  .login-wrapper .notice {
    width: auto;
    margin: 0 12px 12px;
  }

  .provider {
    min-width: 0;
    padding: 12px;
  }

  .provider-icon {
    width: 48px;
    height: 48px;
  }

  .login-footer {
    display: none;
  }

  .login-footer-mobile {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
  }

  .login-footer-mobile .links {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
  }
}

/* ── inbox layout ── */
.layout {
  display: flex;
  height: 100vh;
  background: #fff;
  overflow: hidden;
}

.sider {
  position: relative;
  z-index: 13;
  flex: none;
  width: 200px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden auto;
  transition: width 0.2s ease-in-out;
}

.layout.is-collapsed .sider {
  width: 64px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--header-height);
  padding: 28px 24px;
  cursor: pointer;
}

.logo img {
  height: 32px;
}

.logo .logo-small {
  display: none;
}

.is-collapsed .logo {
  padding: 0;
}

.is-collapsed .logo .logo-full {
  display: none;
}

.is-collapsed .logo .logo-small {
  display: block;
  width: 32px;
}

.menu {
  padding: 0 0 6px;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 42px;
  margin: 6px 0 0;
  padding: 0 18px 0 24px;
  color: var(--menu-ink);
  white-space: nowrap;
  transition: color 0.3s;
}

.menu-item::before {
  content: '';
  position: absolute;
  inset: 0 8px;
  border-radius: 3px;
  background: transparent;
  transition: background-color 0.3s;
  z-index: -1;
}

.menu-item .ico {
  margin: 0 8px 0 0;
  color: var(--ink);
}

.menu-item:hover {
  color: var(--primary);
}

.menu-item.is-active,
.menu-item.is-active .ico {
  color: #fff;
}

.menu-item.is-active::before {
  background: var(--primary);
}

.menu {
  isolation: isolate;
}

.is-collapsed .menu-item {
  padding: 0 22px;
}

.is-collapsed .menu-item span:last-child {
  display: none;
}

.is-collapsed .menu-item .ico {
  margin: 0;
}

.side-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.side-footer a {
  display: block;
  line-height: 26px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.is-collapsed .side-footer {
  padding: 10px;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.top {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
  padding: 0 24px;
  gap: 28px;
}

.top-left,
.top-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.trigger {
  display: inline-flex;
  align-items: center;
  height: var(--header-height);
  color: var(--menu-ink);
}

.trigger:disabled {
  opacity: 0.5;
  cursor: default;
}

.trigger.is-busy .ico {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.account {
  position: relative;
}

.avatar-button {
  display: flex;
  align-items: center;
  height: var(--header-height);
}

.avatar-button img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.account-menu {
  position: absolute;
  top: calc(var(--header-height) - 20px);
  right: 0;
  z-index: 20;
  min-width: 200px;
  padding: 4px 0;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
}

.account-email {
  display: block;
  padding: 8px 14px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--faint);
}

.account-action {
  display: block;
  width: 100%;
  padding: 0 14px;
  height: 34px;
  text-align: left;
  color: var(--menu-ink);
}

.account-action:hover {
  background: rgba(46, 51, 56, 0.09);
}

.banner {
  flex: none;
  margin: 0 24px 12px;
}

.main-view {
  flex: 1;
  min-height: 0;
  padding: 0 24px 24px 0;
}

.inbox-wrapper {
  height: 100%;
  border-radius: 16px;
  background: #f5f7fa;
}

.inbox-content {
  height: 100%;
  padding: 24px;
  display: flex;
  overflow: auto;
}

.pane-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.search-wrap {
  flex: none;
  position: relative;
  padding: 24px;
}

.search-input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 40px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--menu-ink);
  font: inherit;
  font-size: 15px;
  outline: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input::placeholder {
  color: #c2c2c2;
}

.search-input::-webkit-search-cancel-button {
  margin-right: 4px;
  cursor: pointer;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 207, 118, 0.2);
}

.search-icon {
  position: absolute;
  right: 36px;
  top: 34px;
  color: #c2c2c2;
  pointer-events: none;
}

.email-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden auto;
}

.email-item {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border-left: 4px solid transparent;
  text-align: left;
  cursor: pointer;
}

.email-item:hover,
.email-item.is-active {
  background: var(--primary-soft);
}

.email-item.is-active {
  border-left-color: var(--primary);
}

.email-item .title,
.email-item .content {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.email-item .title {
  font-size: 16px;
  font-weight: bold;
  line-height: 18px;
  color: var(--ink);
}

.email-item .content {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  color: var(--ink);
}

.email-item .date-time {
  display: block;
  margin: 16px 0 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  color: var(--faint);
}

.skeleton {
  height: 80px;
  margin: 0 0 16px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.12) 37%, rgba(0, 0, 0, 0.06) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.8s ease infinite;
}

@keyframes skeleton {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: rgba(194, 194, 194, 1);
}

.empty p {
  color: #999;
  font-size: 14px;
}

.empty .ico-empty {
  color: #c2c2c2;
}

.empty-error {
  color: #b3261e;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--primary);
  border-radius: 3px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
}

.pane-detail {
  display: flex;
  flex-direction: column;
  flex: 2;
  min-width: 0;
  margin: 0 0 0 24px;
  border-radius: 8px;
  background: #fff;
  overflow: hidden auto;
}

.back {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 24px 0 0 24px;
  align-self: flex-start;
  color: var(--menu-ink);
}

.back:hover {
  color: var(--primary);
}

.detail-head {
  display: flex;
  align-items: center;
  padding: 24px;
}

.detail-head img {
  flex: none;
  width: 40px;
  height: 40px;
}

.detail-from {
  min-width: 0;
  margin: 0 0 0 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.detail-from b {
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-from small {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-info {
  padding: 16px 24px;
}

.detail-info h2 {
  font-size: 20px;
  font-weight: bold;
  line-height: normal;
  color: var(--ink);
  word-break: break-word;
}

.detail-info time {
  display: block;
  margin: 16px 0 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  color: var(--faint);
}

.detail-content {
  flex: 1;
  min-height: 240px;
  padding: 8px 24px 24px;
  display: flex;
}

.mail-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

@media screen and (max-width: 900px) {
  /* one pane at a time on a phone */
  .panes-list .pane-detail,
  .panes-detail .pane-list {
    display: none;
  }

  .pane-list {
    width: 100%;
  }

  .pane-detail {
    margin: 0;
  }

  .back {
    display: inline-flex;
  }

  .top-right .trigger-fullscreen {
    display: none;
  }
}
