/* Mastodon embed feed timeline v3.13.2 */
/* More info at: */
/* https://gitlab.com/idotj/mastodon-embed-feed-timeline */

/* Variables */
:root {
  --text-max-lines: none;
}

/* Theme colors */
:root,
html[data-theme="light"] {
  --bg-color: #151a1f;
  --bg-hover-color: #43314056;
  --line-gray-color: #677096;
  --contrast-gray-color: #7581a4;
  --content-text: #d5d5d5;
  --error-text-color: #fe6c6c;
  --reaction-color : #93829f54;
}
#mt-container.mastTL{

      align-items: center;
    justify-content: center;
    align-self: center;
    
}

/* Main container */
.mt-container {
  width: 90%;
  /* height: 100%; */
  /* スクロールする */
  margin-left: auto;
  margin-right: auto;
  max-height: 300px;
  overflow-y: auto;
  position: relative;
  background: var(--bg-color);
  /* scrollbar-color: var(--bg-hover-color) rgba(0, 0, 0, 0.1); */
  /* scrollbar-width: thin; */
  border: 1px solid #637383;
  border-radius: 10px


}
.mt-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.mt-container::-webkit-scrollbar-thumb {
  background-color:#3a706a;
  border: none;
  border-radius: 8px;
}
.mt-container::-webkit-scrollbar-thumb:hover,
.mt-container::-webkit-scrollbar-thumb:active {
  background-color:#4d938b;
}
.mt-container::-webkit-scrollbar-track {
  background-color: transparent;
  border: none;
  border-radius: 0;
}
.mt-container::-webkit-scrollbar-track:hover,
.mt-container::-webkit-scrollbar-track:active,
.mt-container::-webkit-scrollbar-corner {
  background-color: transparent;
}
::-webkit-scrollbar-corner {
  background: #323d4b; 
}
.mt-container a:link,
.mt-container a {
  text-decoration: none;
  color: hsl(175, 40%, 66%);
}
.mt-container a:active {
  color:hsl(175, 40%, 78%);
}
.mt-container a:not(.mt-toot-preview):hover {
  text-decoration: underline;
}
.mt-body {
  /* padding: 1rem clamp(0.25rem, 4vw, 1.5rem); */
  /* 区切り線を横いっぱいにする */
  padding: 0;
  white-space: normal;
  word-wrap: break-word;
}
.mt-body .invisible {
  font-size: 0;
  line-height: 0;
  display: inline-block;
  width: 0;
  height: 0;
  position: absolute;
}


.mt-header-wrap {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #151a1f;
}

.mt-header-text {
  padding: 10px 8px 4px;
  font-family: "PoxiaoPixel";
  color: #eee;
  text-align: center;
}

.mt-header-text::after {
  content: "";
  display: block;
  height: 1px;
  margin: 8px 12px 0;
  background-color: #7880a5;
  opacity: 0.5;
}


/* Toot container */
.mt-toot {
  /* margin: 0.25rem; */
  /* 区切り線を横いっぱいにする */
  margin: 0;
  /* padding: 1rem 0.5rem; */
  padding: .8rem .8rem 0;
  position: relative;
  min-height: 3.75rem;
  background-color: transparent;
  margin-bottom: 1rem; /* 保持原有下边距 */
  padding-bottom: 1rem; /* 增加底部内边距 */
}

.mt-toot:not(:last-child)::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    height: 1px;
    background-color: #7880a5;
    opacity: 0.5;
}

/* .mt-toot:hover,
.mt-toot:focus {
  cursor: pointer;
  background-color: var(--bg-hover-color);
} */
.mt-toot p:last-child {
  margin-bottom: 0;
}

/* User avatar */
.mt-toot-avatar {
  margin-right: 0.75rem;
}
.mt-toot-avatar-standard {
  width: 3rem;
  height: 3rem;
}
.mt-toot-avatar-boosted {
  width: 3rem;
  height: 3rem;
  position: relative;
}
.mt-toot-avatar-image-big img {
  aspect-ratio: 1/1;
  /* width: 2.25rem;
  height: 2.25rem; */
  width: 100%;
  border-radius: 0.25rem;
  overflow: hidden;
}
.mt-toot-avatar-image-small img {
  aspect-ratio: 1/1;
  /* width: 1.5rem;
  height: 1.5rem; */
  width: 1.8rem;
  height: 1.8rem;
  /* top: 1.5rem;
  left: 1.5rem; */
  top: 1.8rem;
  left: 1.8rem;
  position: absolute;
  border-radius: 0.25rem;
  overflow: hidden;
}


/* User name and date */
.mt-toot-header {
  display: flex;
  justify-content: space-between;
  /* align-items: flex-start; */
  align-items: center;
  margin-bottom: 1rem;
}
.mt-toot-header-user {
  font-weight: 600;
  /* margin-top: 0.5rem; */
  padding-right: 1rem;
}
.mt-toot-header-user > a {
  display: flex;
  align-items: flex-start;
  color: #eee!important;
  overflow-wrap: anywhere;

}
.mt-toot-header-date {
  /* font-size: 0.75rem; */
  font-size: 0.75em;
  text-align: right;
  /* margin: 0.5rem 0 0 auto; */
  margin: 0rem 0 0 auto;
}
.mt-toot-header-date > a {
  color: var(--contrast-gray-color) !important;
}



/* Text */
.mt-toot-text {
  /* margin-bottom: 1rem; */
  margin: 0 .3rem 1rem;
  color: var(--content-text);
  font-size: .9em;

}
h1 {
  font-size: 1.5rem;
}
h2 {
  font-size: 1.2rem;
}
.mt-toot-text .spoiler-btn {
  display: inline-block;
}
.mt-toot-text .spoiler-text-hidden {
  display: none;
}
.mt-toot-text.truncate {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: var(--text-max-lines);
  -webkit-box-orient: vertical;
}
.mt-toot-text:not(.truncate) .ellipsis::after {
  content: "...";
}
.mt-toot-text blockquote {
  border-left: 0.25rem solid var(--line-gray-color);
  margin-left: 0;
  padding-left: 0.5rem;
}
.mt-toot-header-user .custom-emoji,
.mt-toot-text .custom-emoji {
  height: 1.5rem;
  min-width: 1.5rem;
  margin-bottom: -0.25rem;
  width: auto;
}

/* Poll */
.mt-toot-poll {
  margin: 1rem;
  color: var(--content-text);

}
.mt-toot-poll ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mt-toot-poll ul li {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.mt-toot-poll.mt-toot-poll-expired ul li {
  color: var(--contrast-gray-color);
}
.mt-toot-poll ul li:not(:last-child) {
  margin-bottom: 1rem;
}
.mt-toot-poll ul li:before {
  content: "◯";
  padding-right: 0.5rem;
}
.mt-toot-poll.mt-toot-poll-expired ul li:before {
  content: "";
  padding-right: 0;
}

/* Medias */
.mt-toot-media {
  position: relative;
  overflow: hidden;
  /* margin-bottom: 1rem; */
  margin: 0 .6rem 1rem;
  cursor: pointer;
}
.mt-toot-media > .spoiler-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
}


.mt-toet-media.img-ratio14_7,
.mt-toot-media.video-ratio14_7 {
  padding-top: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.mt-toot-media > audio {
  width: 100%;
  position: relative;
  z-index: 1;
}
.img-ratio14_7 > img,
.video-ratio14_7 > img,
.video-ratio14_7 > video {
  width: 100%;
  height: auto;
  max-height: 300px; /* 添加最大高度限制 */
  object-fit: contain; /* 保持比例 */
  position: static;
  top: auto;
  left: auto;
  transform: none;
}
.mt-toot-media.loading-spinner .mt-toot-media-play-icon {
  display: none;
}
.mt-toot-media-play-icon {
  display: flex;
  position: absolute;
  width: 3rem;
  height: 3rem;
  top: calc(50% - 1.5rem);
  left: calc(50% - 1.5rem);
  justify-content: center;
  align-items: center;
  background-color: transparent;
  border: none;
  cursor: pointer;
}
.mt-toot-media-play-icon > svg {
  width: 2.5rem;
  height: 2.5rem;
  fill: var(--bg-color);
  stroke:var(--content-text);
  stroke-width: 1px;
}

/* Preview link */
.mt-toot-preview {
  min-height: 4rem;
  display: flex;
  flex-direction: row;
  border: 1px solid var(--line-gray-color);
  border-radius: 0.5rem;
  font-size: 0.8rem;
  margin: 1rem 0.6rem;
  overflow: hidden;
}
.mt-toot-preview-image {
  width: 40%;
  align-self: stretch;
}
.mt-toot-preview-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: var(--content-text);
}
.mt-toot-preview-noImage {
  width: 40%;
  font-size: 1.5rem;
  align-self: center;
  text-align: center;
}
.mt-toot-preview-content {
  width: 60%;
  display: flex;
  align-self: center;
  flex-direction: column;
  padding: 0.5rem 1rem;
  gap: 0.5rem;
}
.mt-toot-preview-title {
  font-weight: 600;
}

/* Spoiler button */
.spoiler-btn {
  border-radius: 2px;
  background-color:#55557c;

  color: #cfcfcf;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0 0.35rem;
  text-transform: uppercase;
  line-height: 1.25rem;
  cursor: pointer;
  /* vertical-align: top; */
  vertical-align: middle;
}

/* Counter bar */
.mt-toot-counter-bar {
  display: flex;
  min-width: 6rem;
  max-width: 40rem;
  justify-content: space-between;
  color: var(--contrast-gray-color);
  margin: 1rem .6rem;
}
.mt-toot-counter-bar-replies,
.mt-toot-counter-bar-reblog,
.mt-toot-counter-bar-favorites {
  display: flex;
  font-size: 0.75rem;
  gap: 0.25rem;
  align-items: center;
  /* opacity: 0.5; */
  user-select: none;
}
.mt-toot-counter-bar-replies > svg,
.mt-toot-counter-bar-reblog > svg,
.mt-toot-counter-bar-favorites > svg {
  width: 1rem;
  height: auto;
  fill: var(--contrast-gray-color);
}

/* Error */
.mt-error {
  position: absolute;
  display: flex;
  flex-direction: column;
  height: calc(100% - 3.5rem);
  width: calc(100% - 4.5rem);
  justify-content: center;
  align-items: center;
  color: var(--error-text-color);
  padding: 0.75rem;
  text-align: center;
}
.mt-error-icon {
  font-size: 2rem;
}
.mt-error-message {
  padding: 1rem 0;
}
.mt-error-message hr {
  color: var(--line-gray-color);
}

/* Loading spinner */
.mt-body > .loading-spinner {
  position: absolute;
  width: 3rem;
  height: 3rem;
  margin: auto;
  top: calc(50% - 1.5rem);
  right: calc(50% - 1.5rem);
}
.loading-spinner {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E%3Cg%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 64 64' to='360 64 64' dur='1000ms' repeatCount='indefinite'/%3E%3Cpath d='M64 6.69a57.3 57.3 0 1 1 0 114.61A57.3 57.3 0 0 1 6.69 64' fill='none' stroke='%23404040' stroke-width='12'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center center;
  background-color: transparent;
  background-size: min(2.5rem, calc(100% - 0.5rem));
}

/* Footer (See more link) */
.mt-footer {
  /* margin: 1rem auto 2rem auto;
  padding: 0 2rem; */
  margin: .8rem auto;
  padding: 0 1rem;
  text-align: center;
  font-family: "PoxiaoPixel" ;
}


/* Hidden elements */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* fedibird: emoji reactions */
.mt-toot-reaction-bar{
  display: flex;
  gap: 4px;
  margin: 1rem .6rem;
}

.mt-toot-reaction-bar .reactions-item{
  background: var(--reaction-color);
  border-radius: 3px;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  padding: 0 6px;
  display: flex;
  align-items: center;
}

.mt-toot-reaction-bar .reactions-item .custom-emoji{
  margin: 3px 0;
  width: auto;
  height: 1.8rem;
}

/* 原生Emoji */
.mt-toot-reaction-bar .emoji-char {
    border-radius: 3px;
    width: auto;
    height: 1.8rem; 
    margin: 3px 0;
    display: inline-block;
    vertical-align: middle;
    font-size: 1.2rem; 
}

.mt-toot-reaction-bar .reactions-item-count{
  display: block;
  font-size: .8rem;
  font-weight: 500;
  text-align: center;
  margin-left: 6px;
  opacity: .9;
}

/* unlisted */
.mt-toot-header-date .unlisted{
  width: 1.4em;
  height: auto;
  fill: var(--contrast-gray-color);
  position: relative;
  top: 3px;
  right: 4px;
}

.mt-toot-header-date .pinnedIcon{
  position: relative;
  left: 4px;
  top: 2px;
}

.spoiler-text-visible{
  margin-top: .4em;
  display: block;
}


@media (min-width: 576px) {
  .mt-container {
    width: 90% !important;

  }
}
/* 移动端适配 */
@media (max-width: 575px) {
  .mastTL {
    display:flex;
    margin: 0 auto;
    padding: 0;
  }
  
  .mt-container {
    max-height: 250px;
    width: 98% !important;
    margin: 0 auto;
  }


}

