:root {
  --font-family: system-ui, -apple-system, "Segoe UI", "Roboto", "Ubuntu",
    "Cantarell", "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol", "Noto Color Emoji";
  --code-font-family: "Fira Code", "Consolas", "Monaco", "Courier New",
    monospace;
  --line-height: 1.5;
  --font-weight: 400;
  --border-radius: 0.25rem;
  --border-width: 1px;
  --outline-width: 3px;
  --spacing: 0.5rem;
  --typography-spacing-vertical: 1.5rem;
  --block-spacing-vertical: calc(var(--spacing) * 2);
  --block-spacing-horizontal: var(--spacing);
  --grid-spacing-vertical: 0;
  --grid-spacing-horizontal: var(--spacing);
  --form-element-spacing-vertical: 0.75rem;
  --form-element-spacing-horizontal: 1rem;
  --nav-element-spacing-vertical: 1rem;
  --nav-element-spacing-horizontal: 0.5rem;
  --nav-link-spacing-vertical: 0.5rem;
  --nav-link-spacing-horizontal: 0.5rem;
  --form-label-font-weight: var(--font-weight);
  --transition: 0.2s ease-in-out;
  --modal-overlay-backdrop-filter: blur(0.25rem);
  --font-size: 16px;
}

[data-theme="light"],
:root:not([data-theme="dark"]) {
  --popup-footer-background-color: #e8eaeb;
  --popup-content-background-color: #ffffff;
  --popup-item-background-color: #f3f5f6;
  --popup-item-hover-background-color: #eaeced;
  --popup-trial-pro-background-color: #f9fbfc;
  --text-black-2: #222222;
  --text-gray-2: #222222;
  --text-gray-6: #666666;
  --text-gray-9: #999999;
  --text-gray-c2: #c2c2c2;
  --service-select-content-shadow: 0px 2px 12px 0px rgba(75, 76, 77, 0.2);
  --service-select-border-color: #fafafa;
  --service-select-selected-background-color: #f3f5f6;
}

@media only screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --popup-footer-background-color: #0d0d0d;
    --popup-content-background-color: #191919;
    --popup-item-background-color: #272727;
    --popup-item-hover-background-color: #333333;
    --popup-trial-pro-background-color: #222222;
    --text-black-2: #ffffff;
    --text-gray-2: #dbdbdb;
    --text-gray-6: #b3b3b3;
    --text-gray-9: #777777;
    --text-gray-c2: #5b5b5b;
    --service-select-content-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.9);
    --service-select-border-color: #2c2c2c;
    --service-select-selected-background-color: #333333;
  }
}

[data-theme="dark"] {
  --popup-footer-background-color: #0d0d0d;
  --popup-content-background-color: #191919;
  --popup-item-background-color: #272727;
  --popup-item-hover-background-color: #333333;
  --popup-trial-pro-background-color: #222222;
  --text-black-2: #ffffff;
  --text-gray-2: #dbdbdb;
  --text-gray-6: #b3b3b3;
  --text-gray-9: #777777;
  --text-gray-c2: #5b5b5b;
  --service-select-content-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.9);
  --service-select-border-color: #2c2c2c;
  --service-select-selected-background-color: #333333;
}

.header-right {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

.pro-input-radio {
  flex: 0 1 24px;
}

:root {
  --font-size: 16px;
}

@media (min-width: 1280px) {
  #mount > header,
  #mount > main,
  #mount > footer {
    max-width: 1280px;
  }
}

html {
  scroll-behavior: smooth;
  /* background-color: rgba(242, 242, 242, 1); */
  font-size: var(--font-size);
  /* if not add the following two styles, in interface setting page, when clicking more themes, */
  /* the page will jitter because the scrollbar occupies some width space */
  width: 100vw;
  overflow-x: hidden;
}

body {
  font-size: var(--font-size);
  overflow-x: hidden;
}

#mount > main {
  /* padding-top: calc(var(--block-spacing-vertical) + 3.5rem); */
  padding-left: var(--block-spacing-vertical);
  padding-right: var(--block-spacing-vertical);
}

#mount > nav {
  --nav-link-spacing-vertical: 1rem;
  padding-left: var(--block-spacing-horizontal);
  padding-right: var(--block-spacing-horizontal);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 99;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  backdrop-filter: saturate(180%) blur(20px);
  background-color: var(--nav-background-color);
  box-shadow: 0px 1px 0 var(--nav-border-color);
}

main > aside > nav ul {
  margin: 0 !important;
}

@media (min-width: 992px) {
  #mount > nav ul:first-of-type li:nth-of-type(2) {
    display: inline;
  }
}

@media (min-width: 992px) {
  #mount > main {
    --block-spacing-horizontal: calc(var(--spacing) * 1.75);
  }
}

@media (min-width: 1200px) {
  #mount > main {
    --block-spacing-horizontal: calc(var(--spacing) * 2);
    grid-column-gap: calc(var(--block-spacing-horizontal) * 3);
    display: grid;
    grid-template-columns: 250px auto;
  }
}

#mount > main > aside,
#mount > main div[role="main"] {
  min-width: 0;
}

.menu-nav {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding-bottom: var(--block-spacing-vertical);
}

textarea::placeholder {
  opacity: 0.3;
}

@media (max-width: 576px) {
  .menu-nav a {
    font-size: 14px !important;
  }
}

@media (min-width: 1200px) {
  .menu-nav {
    position: fixed;
    width: 250px;
    max-height: calc(100vh - 5.5rem);
  }
}

a[role="button"] {
  padding: 0.4rem 1rem;
}

a.no-focus:focus,
[role="link"]:focus {
  --background-color: transparent;
}

.immersive-translate-status {
  font-size: 0.875rem;
}

hgroup.hgroup {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: center;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.nav-left {
  flex-shrink: 0;
  flex: 6;
  padding-right: 1.2rem;
}

.nav-right {
  display: flex;
  flex: 0 1 10rem;
  justify-content: flex-end;
}

.select {
  display: flex;
  align-items: center;
  margin: 0;
  flex: 0 1 10rem;
  max-height: 12rem;
}

.title {
  line-height: 1.6rem;
}

.description {
  color: rgb(148 163 184);
  font-size: 15px;
}

.input-row {
  display: flex;
  padding: 0.5rem 0rem;
}

input.input {
  margin-bottom: 0;
  max-height: 2.6rem;
}

label {
  margin: 0;
}

.input-raw-left {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 6rem;
}

.input-left {
  display: flex;
  flex: 1 1 4rem;
  max-width: 6rem;
  justify-content: flex-end;
  align-items: center;
}

.input-right {
  flex: 1 1 auto;
  margin: 0;
}

.confirm-button {
  margin: 0.4rem 9rem;
  padding: 0.4rem 1rem;
}

.option-list {
  max-height: 16rem;
  overflow: scroll;
}

.langs-list {
  display: flex;
  flex-wrap: wrap;
}

.lang-card {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(233, 233, 233, 1);
  margin-right: 1.1rem;
  margin-bottom: 0.8rem;
  color: rgb(148 163 184);
  border-radius: 0.15rem;
  font-size: 17px;
  /* background-color: rgba(249, 249, 249, 1); */
}

.close {
  width: 0.8rem;
  height: 0.8rem;
  margin-left: 0.4rem;
  background-image: var(--icon-close);
  background-size: auto 0.8rem;
  background-repeat: no-repeat;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.url-list {
  display: flex;
  justify-content: space-between;
  padding: 0 1.3rem;
  /* background-color: rgba(255, 255, 255, 1); */
  align-items: center;
  line-height: 1.5;
}

.url-name {
  font-weight: 500;
  max-width: calc(100% - 100px);
}

.height-tight {
  line-height: 1.2;
}

.url-dot {
  font-size: 1.2rem;
}

.add-button {
  padding: 0.5rem 1rem;
}

nav li[role="list"] a,
label.engine {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

dialog article .close {
  margin-bottom: 0.5rem;
}

article.add-modal {
  width: 30rem;
}

div.add-text {
  font-size: 1.1rem;
  margin: 16px 3px;
}

.footer-button {
  display: flex;
  justify-content: center;
  flex: 1;
  flex-grow: 1;
}

.full-button {
  width: 100%;
  line-height: 1.2rem;
  margin-top: 0.8rem;
}

.margin-left {
  margin-left: 0.5rem;
}

.margin-right {
  margin-right: 0.5rem;
}

nav details[role="list"] summary + ul li {
  width: 6rem;
  text-align: center;
}

.border-color-left {
  display: flex;
  align-items: center;
}

input.border-color-text {
  width: 8rem;
}

input[type="color"] {
  width: 5rem;
}

.reset-color {
  display: flex;
  justify-content: end;
  align-items: center;
}

a.tiny-button {
  padding: 0.2rem 0.6rem;
  margin: 0.3rem 2rem;
}

.url-list-item {
  background: #f3f6f8;
  padding: 12px 0;
  border-radius: 6px;
}

/* dark */

@media (prefers-color-scheme: dark) {
  .url-list-item {
    background: rgba(0, 0, 0, 0.1);
  }
}

.header {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: center;
}

.header img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.header .info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  margin-left: 16px;
}

.header .ops {
  display: flex;
  flex-direction: row;
  align-items: center;
}

@media (max-width: 576px) {
  .header {
    flex-wrap: wrap;
  }

  .hader .ops {
    margin-top: 8px;
  }
}

.info {
  min-width: 240px;
}

.info .info-title {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
}

@media (max-width: 576px) {
  .info .info-title {
    max-width: 200px;
  }
}

@media (prefers-color-scheme: dark) {
  .info .info-title {
    color: #fff;
  }
}

.end-time {
  font-size: 12px;
  color: #c7c7c7;
  white-space: nowrap;
}

.info-primary {
  color: var(--primary) !important;
}

.info .info-subtitle {
  font-size: 14px;
  color: #999;
  margin-right: 10px;
  margin-bottom: 10px;
}

.header a {
  font-size: 14px;
}

.header > div:last-child {
  margin-left: 24px;
}

.header > div.ops {
  margin-left: 0px;
}

.ops > div:last-child {
  margin-left: 24px;
}

.pro-radio-label {
  position: relative;
  display: flex;
  align-items: center;
  margin-inline-start: 0;
  margin-inline-end: 8px;
  cursor: pointer;
  margin-bottom: 16px;
}

article {
  padding: 20px var(--block-spacing-horizontal);
  margin: 16px 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.option-input {
  width: 180px;
}

@media (max-width: 576px) {
  .description {
    font-size: 14px;
  }

  .option-input {
    width: 160px;
  }

  article {
    padding: 20px var(--block-spacing-horizontal);
    margin: 16px 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  }
}

.intro-container {
  border-radius: 24px;
  background: linear-gradient(
    180deg,
    rgba(255, 146, 188, 0.3) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.08);

  margin-top: 16px;
  margin-bottom: 24px;
}

.intro-content {
  display: flex;
  align-items: center;
  padding: 24px 38px;
}

.intro-line {
  background: #ebebeb;
  height: 1px;
  width: 100%;
}

.intro-container img {
  height: 200px;
}

.intro-footer {
  display: none;
}

.intro-right {
  margin-left: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media screen and (max-width: 1200px) and (min-width: 992px) {
  .intro-container {
    flex-wrap: wrap;
    justify-content: center;
  }

  .intro-right {
    margin-left: 0;
  }
}

@media screen and (max-width: 768px) {
  .intro-container {
    display: none;
  }

  .intro-footer {
    display: block;
    font-size: 12px;
  }
}

.intro-right h1 {
  font-size: 18px;
  line-height: normal;
  font-style: normal;
  font-weight: 700;
  margin-bottom: 0;
}

.intro-right p {
  margin-top: 16px;
  font-size: 14px;
  line-height: normal;
  font-weight: 400;
  margin-bottom: 0;
}

.intro-night-img {
  display: none;
}

@media only screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    .intro-light-img {
      display: none;
    }

    .intro-night-img {
      display: block;
    }
  }
}

[data-theme="dark"] {
  .intro-light-img {
    display: none;
  }

  .intro-night-img {
    display: block;
  }
}

.tags-input-container {
  display: flex;
  flex-wrap: wrap;
}

.tags-input-container .tag {
  border: 1px solid var(--form-element-border-color);
  padding: 0 15px;
  border-radius: 8px;
  line-height: 44px;
  display: inline-block;
  margin: 6px;
}

.tags-input-container .input {
  min-width: 60px;
}

.tags-input-container .delete {
  cursor: pointer;
  padding: 10px;
  color: var(--primary);
}

.tags-input-container .add {
  cursor: pointer;
  border: 1px dashed var(--form-element-border-color);
  text-align: center;
}

.code-editor {
  font-family: var(--code-font-family);
}

.error-boundary {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  display: flex;
  padding: 12px;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.88);
  word-break: break-all;
  margin: 12px;
  border-radius: 12px;
  flex-direction: column;
}

.contact-embed {
  margin-left: -1rem;
}

@media screen and (min-width: 1200px) {
  .contact-embed {
    margin-left: -2rem;
  }
}

.display-none {
  display: none;
}

.header-navbar {
  width: 100% !important;
  max-width: 100% !important;
  box-shadow: 0px 2px 2px 0px #0000000f;
  padding: 22px 64px !important;
  position: fixed;
  background-color: var(--background-color);
  display: flex;
  z-index: 2147483647;
  height: 60px;
}

.header-navbar a:hover,
.header-navbar a:focus {
  text-decoration: none;
  background-color: transparent;
}

.header-navbar-height {
  height: 60px;
}

.header-navbar-brand {
  display: flex;
  align-items: center;
}

.header-navbar-brand h1 {
  color: var(--h1-color);
  font-weight: bold;
  font-size: 1rem;
  line-height: 1rem;
  margin: 0 0 0 8px;
}

.header-navbar-item {
  display: flex;
  align-items: center;
}

.header-navbar-item span {
  margin-left: 4px;
  color: var(--h3-color);
}

.header-navbar-item svg {
  fill: var(--h3-color);
}

.menu-nav {
  height: calc(100vh - 180px);
  border-right: 1px solid var(--muted-border-color);
  padding-top: 10px;
}

.version {
  color: #999;
  font-size: 0.85rem;
  align-self: center;
  margin-left: 12px;
}

@media screen and (max-width: 1200px) {
  .menu-nav {
    height: unset;
    border-right: none;
  }
}

@media screen and (max-width: 820px) {
  .header-navbar {
    padding: 12px 16px !important;
    height: 50px;
  }

  .header-navbar-height {
    height: 50px;
  }
}

.store-container .immersive-translate-link {
  color: var(--h5-color);
  text-decoration: underline;
}

.store-container .immersive-translate-link:hover {
  text-decoration-thickness: 2px;
}

/* CJK 使用边框样式 */
[data-lang="zh-CN"] .store-container .immersive-translate-link,
[data-lang="zh-TW"] .store-container .immersive-translate-link,
[data-lang="ja"] .store-container .immersive-translate-link,
[data-lang="ko"] .store-container .immersive-translate-link {
  text-decoration: none;
  border-bottom: 1px solid;
  margin: 0 1px;
}

[data-lang="zh-CN"] .store-container .immersive-translate-link:hover,
[data-lang="zh-TW"] .store-container .immersive-translate-link:hover,
[data-lang="ja"] .store-container .immersive-translate-link:hover,
[data-lang="ko"] .store-container .immersive-translate-link:hover {
  text-decoration: none;
  border-bottom: 2px solid;
}

.youtube-header {
  display: flex;
  align-items: center;
  margin-top: 50px;
}

.youtube-container {
  border-radius: 8px;
  border: 1px solid var(--muted-border-color);
  padding: 0 24px;
  margin-top: 18px;
  margin-bottom: 30px;
}

.manga-enable,
.image-tools-enable {
  display: none;
}

.input-select {
  max-width: 180px;
}

@media screen and (max-width: 576px) {
  .input-select {
    max-width: 160px;
  }
  .header {
    padding: 12px 0.5reœm !important;
    font-size: 14px;
  }

  .header-brand {
    svg {
      width: 24px;
      height: 24px;
    }
  }

  .header-item {
    svg {
      width: 18px;
      height: 18px;
    }
  }

  .mobile-hidden {
    display: none;
  }

  .manga-enable,
  .image-tools-enable {
    display: flex;
  }

  .youtube-header {
    margin-top: 1rem;
  }

  .youtube-container {
    margin-bottom: 1rem;
  }
}
.details-note p {
  font-size: 16px;
}

textarea[disabled] {
  pointer-events: unset;
}

/* --- 翻译服务设置改版修改 --- */
.container-fluid {
  padding: 0 !important;
  column-gap: calc(var(--block-spacing-horizontal) * 2) !important;
}

.translation-service-header {
  justify-content: space-between;
  width: auto;
  padding: 16px 0;
  border-bottom: 1px solid var(--muted-border-color);
}

.online-translate-compare {
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.add-custom-service {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.translation-service-container {
  display: flex;
  overflow: hidden;
}
.translation-service-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1;
  overflow-y: scroll;
  /* 隐藏滚动条 */
  scrollbar-width: none;
  -ms-overflow-style: none;
  &::-webkit-scrollbar {
    display: none;
  }
}

.translation-service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-radius: 8px 0px 0px 8px;
}

.translation-service-item[data-selected="true"],
.translation-service-item:hover {
  background-color: var(--service-bg-hover);
}

.translation-service-item:hover .service-set-default {
  opacity: 1;
}

.translation-service-item-img {
  width: 32px;
  height: 32px;
}

.translation-service-item h3 {
  font-size: 14px;
  font-weight: 500;
  margin-left: 8px;
  margin-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.translation-service-item a {
  font-size: 12px;
}

.add-custom-ai-service,
.service-set-default,
.service-current-default {
  color: #999999;
  font-size: 12px;
  font-weight: 400;
}

.service-set-default {
  cursor: pointer;
}

.translation-service-setting {
  flex-direction: column;
  align-items: center;
  height: 100%;
  overflow-y: scroll;
  background-color: var(--service-bg);
  width: 100%;
  /* 隐藏滚动条 */
  scrollbar-width: none;
  -ms-overflow-style: none;
  &::-webkit-scrollbar {
    display: none;
  }
}

.service-setting-header {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-bottom: 1px solid var(--muted-border-color);
  padding-bottom: 16px;
}

.service-setting-header-introduction {
  font-size: 14px;
  line-height: 1.5;
  margin-top: 12px;
}

.service-setting-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.add-custom-service-modal-content {
  width: 576px;
}

.add-custom-service-modal-content h1 {
  font-size: 17px;
  margin-bottom: 16px;
}

.add-custom-service-item-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;

  /* 隐藏滚动条 */
  scrollbar-width: none;
  -ms-overflow-style: none;
  &::-webkit-scrollbar {
    display: none;
  }
}

.add-custom-service-item {
  width: 32.5%;
  display: flex;
  align-items: center;
  padding: 12px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.add-custom-service-item div {
  font-size: 14px;
}

.add-custom-service-item:hover {
  background-color: var(--service-bg-hover);
}

.service-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-radius: 8px;
  cursor: pointer;
}

.service-group-header div {
  font-size: 14px;
}

.custom-select-container {
  position: relative;
  flex: 1;
  border: 1px solid var(--form-element-border-color);
  height: 3rem;
  border-radius: var(--border-radius);
  width: 10rem;
  min-width: 10rem;
}

@media (max-width: 576px) {
  .custom-select-popup {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .custom-select-content {
    position: relative !important;
    width: max-content;
    max-height: 80% !important;
  }
}

.custom-select-content {
  border-radius: 12px;
  background: var(--popup-content-background-color);
  box-shadow: var(--service-select-content-shadow);
  border: 1px solid var(--service-select-border-color);
  padding: 4px 5px;
  position: absolute;
  right: 0;
  z-index: 100;
  overflow-y: auto;

  scrollbar-width: none;
  -ms-overflow-style: none;
  &::-webkit-scrollbar {
    display: none;
  }
}

#translation-service-select {
  height: 100%;
  padding: 0 16px;
}

.custom-select-current {
  display: flex;
  flex: 1;
  align-items: center;
  color: var(--form-element-color);
}

.custom-select-current img {
  margin-right: 4px;
}

.custom-select-item {
  font-size: 0.8rem;
  padding: 5px 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--form-element-color);
  width: auto;
  overflow: hidden;
  height: 30px;
  line-height: 30px;
}

.custom-select-item-img {
  width: 20px;
  height: 20px;
  margin-right: 4px;
  flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
  .custom-select-item-img {
    margin-right: 6px;
  }
}

.custom-select-content .custom-select-item.selected,
.custom-select-content .custom-select-item:hover {
  background: var(--service-select-selected-background-color);
}

.custom-select-item.default {
  font-size: 14px;
  width: 100%;
  padding: 0;
}

.custom-select-item > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  display: flex;
  align-items: center;
}

.custom-select-item-pro {
  font-size: 12px;
  margin-left: 6px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.custom-select-item-pro img {
  margin: 0 3px;
  width: 20px;
  flex-shrink: 0;
}

.custom-select-group-header {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-gray-9);
  padding: 6px 8px 4px;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
