/*!Animate.css - http://daneden.me/animate*/
.animated {
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}

.animated.infinite {
  -webkit-animation-iteration-count: infinite;
  animation-iteration-count: infinite;
}

@-webkit-keyframes fadeInLeft {
  0% {
    opacity: 0;
    -webkit-transform: translate3d(-40px, 0, 0);
    transform: translate3d(-40px, 0, 0);
  }
  100% {
    opacity: 1;
    -webkit-transform: none;
    transform: none;
  }
}

@keyframes fadeInLeft {
  0% {
    opacity: 0;
    -webkit-transform: translate3d(-40px, 0, 0);
    -ms-transform: translate3d(-40px, 0, 0);
    transform: translate3d(-40px, 0, 0);
  }
  100% {
    opacity: 1;
    -webkit-transform: none;
    -ms-transform: none;
    transform: none;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-width: 256px;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #0f172a;
  font-family: "Xiya Sans", sans-serif;
}

body {
  --page-x-padding: 24px;
  --app-item-width: 112px;
  --app-item-height: 122px;
  --app-icon-size: 76px;
  --app-grid-gap: 18px;
  --app-grid-edge-padding: 8px;
  --app-scroll-fade-size: 86px;
  --apple-squircle-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E%3Cpath fill='black' d='M64 0C90.368 0 102.016 .768 110.464 4.352C118.784 7.808 120.192 9.216 123.648 17.536C127.232 25.984 128 37.632 128 64C128 90.368 127.232 102.016 123.648 110.464C120.192 118.784 118.784 120.192 110.464 123.648C102.016 127.232 90.368 128 64 128C37.632 128 25.984 127.232 17.536 123.648C9.216 120.192 7.808 118.784 4.352 110.464C.768 102.016 0 90.368 0 64C0 37.632 .768 25.984 4.352 17.536C7.808 9.216 9.216 7.808 17.536 4.352C25.984 .768 37.632 0 64 0Z'/%3E%3C/svg%3E");
  user-select: none;
  -webkit-user-select: none;

  margin: 0;
  padding: 0;
  width: 100%;
  min-width: 256px;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  font-family: inherit;
  color: white;
  overflow: hidden;
  overscroll-behavior: none;
  background: #0f172a;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

#wallpaper-background {
  position: fixed;
  inset: -28px;
  z-index: 0;
  width: calc(100vw + 56px);
  height: calc(100vh + 56px);
  height: calc(100dvh + 56px);
  overflow: hidden;
  background-color: #0f172a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms ease;
}

#wallpaper-background::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(6, 10, 20, 0.18), rgba(6, 10, 20, 0.34));
}

#wallpaper-background.is-visible {
  opacity: 1;
}

.wallpaper-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transform: scale(1.055);
  filter: blur(28px) saturate(1.08);
  backface-visibility: hidden;
  will-change: opacity, filter, transform;
  transition:
    opacity 1100ms ease,
    filter 1800ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 1800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wallpaper-layer.is-active {
  opacity: 1;
}

.wallpaper-layer.is-tiny {
  filter: blur(28px) saturate(1.08);
  transform: scale(1.06);
}

.wallpaper-layer.is-medium {
  filter: blur(12px) saturate(1.04);
  transform: scale(1.035);
}

.wallpaper-layer.is-full {
  filter: blur(10px) saturate(1.02);
  transform: scale(1.025);
}

.wallpaper-layer.is-full.is-crisp {
  filter: blur(0) saturate(1);
  transform: scale(1.01);
}

body.wallpaper-glass #wallpaper-background.is-visible {
  opacity: 0.78;
}

body.wallpaper-glass .wallpaper-layer.is-tiny,
body.wallpaper-glass .wallpaper-layer.is-medium,
body.wallpaper-glass .wallpaper-layer.is-full,
body.wallpaper-glass .wallpaper-layer.is-full.is-crisp {
  filter: blur(22px) saturate(1.14) brightness(1.08);
  transform: scale(1.055);
}

@media (prefers-reduced-motion: reduce) {
  #wallpaper-background,
  .wallpaper-layer,
  .device-item,
  #app ul li {
    transition: none;
  }

  #app ul li {
    transform: none;
  }
}

.auth-actions {
  position: fixed;
  top: 28px;
  right: 30px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.auth-actions [hidden] {
  display: none !important;
}

.auth-round-btn {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 12px 26px rgba(21, 32, 62, 0.18);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.auth-round-btn:hover,
.auth-round-btn:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.62);
  outline: none;
}

.auth-round-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.auth-round-btn.is-authenticated {
  background: rgba(255, 255, 255, 0.44);
}

.ai-btn {
  color: rgba(255, 255, 255, 0.96);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(132, 210, 255, 0.22));
}

.ai-btn svg {
  filter: drop-shadow(0 2px 6px rgba(41, 101, 190, 0.2));
}

.user-menu {
  position: absolute;
  top: 0;
  right: 58px;
  width: 190px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow: 0 18px 38px rgba(16, 24, 48, 0.2);
}

.user-menu-profile {
  padding: 4px 6px 2px;
  color: rgba(31, 41, 55, 0.9);
}

.user-menu-profile strong,
.user-menu-profile span {
  display: block;
}

.user-menu-profile span {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(55, 65, 81, 0.62);
}

.user-menu button {
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(31, 41, 55, 0.86);
  text-align: left;
  cursor: pointer;
}

.user-menu button:hover,
.user-menu button:focus-visible {
  background: rgba(255, 255, 255, 0.56);
  outline: none;
}

.user-menu button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.user-menu-divider {
  height: 1px;
  margin: 8px 4px;
  background: rgba(31, 41, 55, 0.12);
}

.ai-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 42;
  background: rgba(13, 18, 34, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.ai-drawer-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.ai-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 43;
  --ai-chat-width: min(448px, 100vw);
  width: min(960px, 100vw);
  color: rgba(25, 34, 58, 0.92);
  opacity: 1;
  pointer-events: none;
  transform: translateX(calc(100% + 24px));
  transition: transform 260ms ease;
}

.ai-drawer.show {
  transform: translateX(0);
}

.ai-drawer-shell {
  position: relative;
  width: var(--ai-chat-width);
  height: 100%;
  margin-left: auto;
  overflow: hidden;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 32px 0 0 32px;
  background: rgba(242, 246, 250, 0.94);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    0 28px 70px rgba(15, 23, 42, 0.28);
}

.ai-drawer-shell::before,
.ai-drawer-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.ai-drawer-shell::before {
  inset: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.72), transparent 30%),
    radial-gradient(circle at 94% 12%, rgba(132, 210, 255, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 46%);
}

.ai-drawer.has-references .ai-drawer-shell {
  width: 100%;
}

.ai-drawer-shell::after {
  inset: 1px;
  border-radius: 31px 0 0 31px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.ai-drawer-header,
.ai-drawer-body {
  position: relative;
  z-index: 3;
}

.ai-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 24px 14px 32px;
}

.ai-drawer.has-references .ai-drawer-header {
  width: var(--ai-chat-width);
  margin-left: auto;
  padding: 22px 24px 14px 32px;
  box-sizing: border-box;
}

.ai-drawer-header h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: rgba(20, 30, 52, 0.9);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ai-beta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  border: 1px solid rgba(41, 101, 190, 0.18);
  border-radius: 999px;
  padding: 1px 7px;
  background: rgba(41, 152, 235, 0.12);
  color: rgba(41, 101, 190, 0.86);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.ai-icon-btn,
.ai-text-btn,
.ai-reference-toggle,
.ai-reference-download,
.ai-send-btn {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.46);
  color: rgba(30, 41, 70, 0.88);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.ai-icon-btn:hover,
.ai-icon-btn:focus-visible,
.ai-text-btn:hover,
.ai-text-btn:focus-visible,
.ai-reference-toggle:hover,
.ai-reference-toggle:focus-visible,
.ai-reference-download:hover,
.ai-reference-download:focus-visible,
.ai-send-btn:hover,
.ai-send-btn:focus-visible {
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(255, 255, 255, 0.78);
  outline: none;
  transform: translateY(-1px);
}

.ai-drawer-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  text-align: center;
}

.ai-icon-btn span {
  display: block;
  transform: translateY(-2px);
}

.ai-clear-btn {
  padding: 0;
}

.ai-clear-btn svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.ai-drawer-body {
  position: relative;
  height: calc(100% - 84px);
  padding: 0 22px 34px;
}

.ai-reference-panel,
.ai-chat-panel {
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.48);
}

.ai-reference-panel {
  position: absolute;
  top: -62px;
  right: calc(var(--ai-chat-width) - 4px);
  bottom: 20px;
  left: 22px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0 18px 0 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transform-origin: right center;
  transition:
    opacity 220ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0ms linear;
}

.ai-reference-panel::after {
  content: "";
  position: absolute;
  top: 28px;
  right: 0;
  bottom: 0;
  border-right: 1px dashed rgba(30, 41, 70, 0.26);
  pointer-events: none;
}

.ai-reference-panel[hidden] {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(14px);
  transition:
    opacity 160ms ease,
    transform 200ms ease,
    visibility 0ms linear 200ms;
}

.ai-reference-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 50px;
  padding: 8px 14px 8px;
  color: rgba(30, 41, 70, 0.84);
  font-weight: 800;
}

.ai-reference-heading {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-reference-header-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.ai-reference-list {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  padding: 18px 0 0 0;
  overflow: auto;
}

.ai-reference-item {
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.46);
  color: rgba(30, 41, 70, 0.86);
  text-align: left;
  user-select: text;
  -webkit-user-select: text;
}

.ai-reference-item.active {
  border-color: rgba(41, 152, 235, 0.55);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.ai-reference-detail {
  display: flex;
  flex: 1;
  flex-direction: column;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.ai-reference-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.ai-reference-detail-count {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 9px;
  color: rgba(41, 101, 190, 0.92);
  background: rgba(41, 152, 235, 0.12);
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
}

.ai-reference-download {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border-radius: 999px;
  padding: 7px 12px;
  color: rgba(41, 101, 190, 0.96);
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  text-decoration: none;
  white-space: nowrap;
}

.ai-reference-download[hidden] {
  display: none !important;
}

.ai-reference-download svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.ai-inline-reference {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 0;
  border-radius: 999px;
  padding: 0 6px;
  color: rgba(41, 101, 190, 0.95);
  background: rgba(41, 152, 235, 0.12);
  font: inherit;
  font-size: 0.88em;
  font-weight: 800;
  line-height: 1.35;
  cursor: pointer;
}

.ai-inline-reference:hover,
.ai-inline-reference:focus-visible {
  color: rgba(20, 70, 150, 0.98);
  background: rgba(41, 152, 235, 0.22);
  outline: none;
}

.ai-reference-title {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.ai-reference-detail-header .ai-reference-title {
  margin-bottom: 0;
}

.ai-reference-content {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(48, 63, 96, 0.76);
  font-size: 13px;
  line-height: 1.55;
  user-select: text;
  -webkit-user-select: text;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
}

.ai-reference-detail .ai-reference-content {
  display: block;
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding: 12px 4px 18px 0;
  color: rgba(34, 48, 78, 0.86);
  font-size: 13.5px;
  line-height: 1.72;
  white-space: normal;
  overflow-wrap: anywhere;
  scrollbar-gutter: stable;
  mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 22px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 22px), transparent 100%);
  -webkit-line-clamp: unset;
}

.ai-reference-detail .ai-reference-content img {
  display: block;
  max-width: 100%;
  max-height: min(56vh, 520px);
  width: auto;
  height: auto;
  margin: 12px auto 16px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
  object-fit: contain;
}

.ai-reference-detail .ai-reference-content figure {
  margin: 12px 0 16px;
}

.ai-reference-detail .ai-reference-content figcaption {
  margin-top: -8px;
  color: rgba(55, 65, 81, 0.58);
  font-size: 12px;
  text-align: center;
}

.ai-reference-detail .ai-reference-content div,
.ai-reference-detail .ai-reference-content section {
  margin: 0.45em 0;
}

.ai-reference-detail .ai-reference-content table {
  width: max-content;
  min-width: 100%;
  margin: 10px 0 16px;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 14px;
  overflow: hidden;
  color: rgba(48, 63, 96, 0.84);
  font-size: 13px;
  line-height: 1.55;
}

.ai-reference-detail .ai-reference-content td,
.ai-reference-detail .ai-reference-content th {
  border-right: 1px solid rgba(41, 101, 190, 0.16);
  border-bottom: 1px solid rgba(41, 101, 190, 0.16);
  padding: 8px 10px;
  vertical-align: top;
  background: rgba(255, 255, 255, 0.38);
}

.ai-reference-detail .ai-reference-content tr:first-child td,
.ai-reference-detail .ai-reference-content tr:first-child th {
  border-top: 1px solid rgba(41, 101, 190, 0.16);
}

.ai-reference-detail .ai-reference-content td:first-child,
.ai-reference-detail .ai-reference-content th:first-child {
  border-left: 1px solid rgba(41, 101, 190, 0.16);
}

.ai-reference-detail .ai-reference-content h1,
.ai-reference-detail .ai-reference-content h2,
.ai-reference-detail .ai-reference-content h3,
.ai-reference-detail .ai-reference-content h4,
.ai-reference-detail .ai-reference-content h5,
.ai-reference-detail .ai-reference-content h6 {
  margin: 0.75em 0 0.35em;
  color: rgba(20, 30, 52, 0.94);
  line-height: 1.32;
}

.ai-reference-detail .ai-reference-content h1 { font-size: 1.32em; }
.ai-reference-detail .ai-reference-content h2 { font-size: 1.22em; }
.ai-reference-detail .ai-reference-content h3 { font-size: 1.12em; }
.ai-reference-detail .ai-reference-content h4,
.ai-reference-detail .ai-reference-content h5,
.ai-reference-detail .ai-reference-content h6 { font-size: 1.04em; }

.ai-reference-detail .ai-reference-content p,
.ai-reference-detail .ai-reference-content ul,
.ai-reference-detail .ai-reference-content ol,
.ai-reference-detail .ai-reference-content dl,
.ai-reference-detail .ai-reference-content blockquote {
  margin: 0.55em 0;
}

.ai-reference-detail .ai-reference-content ul,
.ai-reference-detail .ai-reference-content ol {
  padding-left: 1.45em;
}

.ai-reference-detail .ai-reference-content li {
  margin: 0.25em 0;
}

.ai-reference-detail .ai-reference-content blockquote {
  border-left: 3px solid rgba(41, 152, 235, 0.32);
  padding: 0.1em 0 0.1em 0.8em;
  color: rgba(48, 63, 96, 0.74);
}

.ai-reference-detail .ai-reference-content a {
  color: rgba(41, 101, 190, 0.95);
  text-decoration: none;
  border-bottom: 1px solid rgba(41, 101, 190, 0.24);
}

.ai-reference-detail .ai-reference-content code {
  border-radius: 7px;
  padding: 0.08em 0.34em;
  background: rgba(255, 255, 255, 0.6);
  color: rgba(85, 54, 150, 0.96);
  font-size: 0.92em;
}

.ai-reference-detail .ai-reference-content pre {
  overflow: auto;
  border-radius: 14px;
  padding: 12px;
  background: rgba(28, 38, 66, 0.86);
  color: rgba(255, 255, 255, 0.92);
}

.ai-reference-detail .ai-reference-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.ai-reference-detail .ai-reference-content hr {
  height: 1px;
  border: 0;
  margin: 14px 0;
  background: rgba(41, 101, 190, 0.14);
}

.ai-reference-detail .ai-reference-content br {
  line-height: 1.7;
}

.ai-structured-reference {
  display: block;
}

.ai-structured-reference p {
  margin: 0.65em 0;
}

.ai-structured-reference-heading {
  margin: 1.05em 0 0.35em !important;
  color: rgba(20, 30, 52, 0.94);
  line-height: 1.5;
}

.ai-structured-reference-heading:first-child {
  margin-top: 0 !important;
}

.ai-structured-reference-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.35em;
  margin: 0.35em 0 !important;
  padding-left: 0.65em;
}

.ai-structured-reference-marker {
  color: rgba(41, 101, 190, 0.9);
  font-weight: 800;
  white-space: nowrap;
}

.ai-structured-reference-body {
  margin: 0.55em 0 !important;
}

.ai-structured-reference strong {
  color: rgba(20, 30, 52, 0.94);
  font-weight: 900;
}

.ai-reference-file-content {
  display: block !important;
}

.ai-reference-detail-section {
  border-top: 1px dashed rgba(41, 152, 235, 0.26);
  padding: 14px 0;
}

.ai-reference-detail-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.ai-reference-detail-section:last-child {
  padding-bottom: 0;
}

.ai-reference-detail-section-title {
  display: block;
  margin-bottom: 8px;
  color: rgba(41, 101, 190, 0.92);
  font-size: 12px;
  font-weight: 900;
}

.ai-reference-detail-section-content {
  color: rgba(34, 48, 78, 0.86);
  font-size: 13.5px;
  line-height: 1.72;
}

.ai-reference-detail-section-content > :first-child {
  margin-top: 0;
}

.ai-reference-detail-section-content > :last-child {
  margin-bottom: 0;
}

.ai-chat-panel {
  position: absolute;
  top: 0;
  right: 22px;
  bottom: 20px;
  width: calc(var(--ai-chat-width) - 44px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.ai-message-list {
  flex: 1;
  min-height: 0;
  padding: 22px 18px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  user-select: none;
  -webkit-user-select: none;
  scroll-behavior: auto;
  overflow-anchor: none;
  contain: layout paint;
}

.ai-message-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: visible;
  isolation: isolate;
}

.ai-message {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 20px;
  word-break: break-word;
  line-height: 1.58;
  font-size: 15px;
  user-select: none;
  -webkit-user-select: none;
}

.ai-message.user {
  align-self: flex-end;
  padding: 9px 14px;
  color: white;
  line-height: 1.42;
  background: #2998eb;
  box-shadow: 0 12px 24px rgba(41, 152, 235, 0.18);
}

.ai-message.user.is-sticky-question {
  position: sticky;
  top: 0;
  z-index: 8;
}

.ai-message.user.is-sticky-question.is-stuck {
  background: rgba(41, 152, 235, 0.94);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 14px 28px rgba(41, 152, 235, 0.16);
}

.ai-message.assistant {
  align-self: flex-start;
  color: rgba(30, 41, 70, 0.92);
  background: rgba(255, 255, 255, 0.62);
}

.ai-message.failed {
  color: rgba(170, 43, 43, 0.92);
  background: rgba(255, 235, 235, 0.72);
}

.ai-message-content {
  display: block;
  user-select: text;
  -webkit-user-select: text;
}

.ai-message-content * {
  user-select: text;
  -webkit-user-select: text;
}

.ai-message-content h1,
.ai-message-content h2,
.ai-message-content h3 {
  margin: 0.35em 0 0.45em;
  color: rgba(20, 30, 52, 0.94);
  line-height: 1.3;
}

.ai-message-content h1 {
  font-size: 1.28em;
}

.ai-message-content h2 {
  font-size: 1.18em;
}

.ai-message-content h3 {
  font-size: 1.08em;
}

.ai-message-content p {
  margin: 0.4em 0;
}

.ai-message-content ul,
.ai-message-content ol {
  margin: 0.45em 0;
  padding-left: 1.35em;
}

.ai-message-content li {
  margin: 0.22em 0;
}

.ai-message-content strong {
  color: rgba(18, 29, 52, 0.96);
  font-weight: 800;
}

.ai-message-content code {
  border-radius: 7px;
  padding: 0.08em 0.34em;
  background: rgba(255, 255, 255, 0.58);
  color: rgba(85, 54, 150, 0.96);
  font-size: 0.92em;
}

.ai-message-content pre {
  margin: 0.6em 0;
  overflow: auto;
  border-radius: 14px;
  padding: 12px;
  background: rgba(28, 38, 66, 0.86);
  color: rgba(255, 255, 255, 0.92);
}

.ai-message-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.ai-message-content blockquote {
  margin: 0.6em 0;
  border-left: 3px solid rgba(126, 78, 255, 0.42);
  padding: 0.12em 0 0.12em 0.75em;
  color: rgba(48, 63, 96, 0.78);
}

.ai-message-content a {
  color: rgba(55, 102, 210, 0.95);
  text-decoration: none;
  border-bottom: 1px solid rgba(55, 102, 210, 0.24);
}

.ai-suggested-questions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  text-align: left;
  white-space: normal;
}

.ai-suggested-questions-title {
  color: rgba(48, 63, 96, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.ai-suggested-question-list {
  display: grid;
  gap: 8px;
}

.ai-suggested-question-button {
  display: flex;
  align-items: center;
  min-height: 44px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 16px;
  padding: 10px 12px;
  color: rgba(30, 41, 70, 0.86);
  background: rgba(255, 255, 255, 0.42);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.ai-suggested-question-button span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-suggested-question-button:hover,
.ai-suggested-question-button:focus-visible {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.72);
  outline: none;
  transform: translateY(-1px);
}

.ai-suggested-question-button:disabled {
  color: rgba(55, 65, 81, 0.46);
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.32);
  cursor: not-allowed;
  transform: none;
}

.ai-message-references {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
  white-space: normal;
}

.ai-message-references-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 16px;
  padding: 9px 12px;
  color: rgba(30, 41, 70, 0.78);
  background: rgba(255, 255, 255, 0.42);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.ai-message-references-summary::after {
  content: "展开";
  flex: 0 0 auto;
  color: rgba(41, 101, 190, 0.88);
}

.ai-message-references.expanded .ai-message-references-summary::after {
  content: "收起";
}

.ai-message-references-summary:hover,
.ai-message-references-summary:focus-visible {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.72);
  outline: none;
  transform: translateY(-1px);
}

.ai-message-references-list {
  display: none;
  grid-template-columns: 1fr;
  gap: 8px;
}

.ai-message-references.expanded .ai-message-references-list {
  display: grid;
}

.ai-reference-toggle {
  display: grid;
  gap: 4px;
  min-height: 44px;
  border-radius: 16px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
}

.ai-reference-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-reference-toggle small {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(48, 63, 96, 0.66);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ai-bubble-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: rgba(48, 63, 96, 0.72);
  font-size: 13px;
  user-select: none;
  -webkit-user-select: none;
}

.ai-bubble-loading[hidden] {
  display: none;
}

.ai-message-content:empty + .ai-bubble-loading {
  margin-top: 0;
}

.ai-message-streaming {
  display: flex;
}

.ai-thinking-text {
  opacity: 1;
  transition: opacity 260ms ease;
}

.ai-thinking-text.is-fading {
  opacity: 0;
}

.ai-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px 14px;
  color: rgba(48, 63, 96, 0.72);
  font-size: 13px;
}

.ai-thinking[hidden] {
  display: none;
}

.ai-thinking-dots {
  display: inline-flex;
  gap: 6px;
}

.ai-thinking-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: auth-loading-dot 780ms ease-in-out infinite;
}

.ai-thinking-dots span:nth-child(2) {
  animation-delay: 120ms;
}

.ai-thinking-dots span:nth-child(3) {
  animation-delay: 240ms;
}

.ai-message-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: stretch;
  gap: 10px;
  padding: 14px;
  min-height: clamp(106px, 14vh, 138px);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}

.ai-message-form textarea {
  width: 100%;
  height: clamp(76px, 10vh, 110px);
  min-height: 76px;
  max-height: 110px;
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  padding: 10px 16px;
  color: rgba(30, 41, 70, 0.92);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
  font-size: 15px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  user-select: text;
  -webkit-user-select: text;
}

.ai-message-form textarea::-webkit-scrollbar {
  display: none;
}

.ai-message-form textarea::placeholder {
  color: rgba(48, 63, 96, 0.38);
  font-size: 13px;
  line-height: 1.42;
  text-align: center;
}

.ai-message-form textarea:focus {
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

.ai-send-btn {
  min-height: 56px;
  border-radius: 20px;
  font-weight: 800;
}

.ai-send-btn:disabled,
.ai-clear-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.ai-text-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
}

.ai-empty-state {
  padding: 18px 10px;
  color: rgba(70, 86, 123, 0.64);
  text-align: center;
  font-size: 13px;
  user-select: none;
  -webkit-user-select: none;
}

/* AI 深度思考徽章与浮层气泡 */
.ai-think-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 3px 10px;
  border: 1px solid rgba(120, 80, 220, 0.22);
  border-radius: 999px;
  background: rgba(120, 80, 220, 0.08);
  color: rgba(90, 50, 180, 0.72);
  font-size: 12px;
  font-weight: 700;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease;
}

.ai-think-badge:hover {
  background: rgba(120, 80, 220, 0.14);
  border-color: rgba(120, 80, 220, 0.36);
}

.ai-think-badge svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  flex-shrink: 0;
}

.ai-think-popover-floating {
  position: fixed;
  z-index: 9999;
  max-width: min(380px, calc(100vw - 24px));
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(242, 238, 255, 0.96);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 40px rgba(80, 50, 180, 0.2);
  color: rgba(50, 30, 100, 0.84);
  font-size: 12.5px;
  line-height: 1.68;
  font-weight: 400;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-gutter: stable;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, visibility 0ms linear 160ms;
}

.ai-think-popover-floating.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 160ms ease, visibility 0ms linear;
}

.ai-think-popover-floating::-webkit-scrollbar {
  width: 4px;
}

.ai-think-popover-floating::-webkit-scrollbar-track {
  background: transparent;
}

.ai-think-popover-floating::-webkit-scrollbar-thumb {
  background: rgba(120, 80, 220, 0.28);
  border-radius: 2px;
}

#wrap {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  padding: 130px var(--page-x-padding) 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

#wrap > div {
  width: 100%;
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#top {
  position: absolute;
  top: 50px;
  left: 0;
  width: 100%;
  padding: 0 var(--page-x-padding);
  text-align: center;
  z-index: 10;
}

#logo {
  display: none;
  text-align: center;
}

#logo.is-wallpaper-toggle {
  cursor: pointer;
}

#logo.is-wallpaper-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 8px;
  border-radius: 18px;
}

#logo img {
  max-width: min(260px, 60vw);
  max-height: 80px;
  width: auto;
  display: block;
  margin: 0 auto 40px;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.32)) drop-shadow(0 10px 28px rgba(0, 0, 0, 0.32));
  transition: filter 260ms ease, transform 260ms ease;
}

#logo.is-wallpaper-toggle:hover img,
#logo.is-wallpaper-toggle:focus-visible img {
  transform: translateY(-1px);
  filter: drop-shadow(0 0 24px rgba(255, 255, 255, 0.42)) drop-shadow(0 14px 34px rgba(0, 0, 0, 0.36));
}

#main {
  width: min(100%, calc(100vw - (var(--page-x-padding) * 2)));
  max-width: min(1800px, calc(100vw - (var(--page-x-padding) * 2)));
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin-top: 22px;
}

#From_WorkApp {
  width: 100%;
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
  min-height: min(42vh, 360px);
}

#app ul {
  list-style: none;
  padding: var(--app-grid-edge-padding) 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--app-item-width), var(--app-item-width)));
  gap: var(--app-grid-gap);
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 214px);
  max-height: calc(100dvh - 214px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0);
  justify-content: center;
  justify-items: center;
  align-content: start;
}

#app ul.has-overflow-before,
#app ul.has-overflow-after {
  --app-scroll-fade-top: 0px;
  --app-scroll-fade-bottom: 0px;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 var(--app-scroll-fade-top),
    #000 calc(100% - var(--app-scroll-fade-bottom)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 var(--app-scroll-fade-top),
    #000 calc(100% - var(--app-scroll-fade-bottom)),
    transparent 100%
  );
}

#app ul.has-overflow-before {
  --app-scroll-fade-top: var(--app-scroll-fade-size);
}

#app ul.has-overflow-after {
  --app-scroll-fade-bottom: var(--app-scroll-fade-size);
}

#app ul:hover {
  scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
}

/* Webkit scrollbar styling */
#app ul::-webkit-scrollbar {
  width: 6px;
  background: transparent;
}

#app ul::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

#app ul::-webkit-scrollbar-thumb {
  background: #888; /* 使用灰色滚动条 */
  border-radius: 3px;
  transition: all 0.3s ease;
  min-height: 20px;
}

#app ul::-webkit-scrollbar-thumb:hover {
  background: #666; /* 悬停时更深的颜色 */
}

/* 默认隐藏滚动条，滚动时短暂显示 */
#app ul::-webkit-scrollbar-thumb:window-inactive {
  background: transparent;
}

#app ul {
  -ms-overflow-style: none;
  scrollbar-width: thin;
  overflow-y: auto;
}

/* 触屏设备上隐藏滚动条 */
@media (hover: none) and (pointer: coarse) {
  #app ul {
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: none;
  }

  #app ul::-webkit-scrollbar {
    display: none;
  }
}

#app ul li {
  margin: 0;
  width: var(--app-item-width);
  min-height: var(--app-item-height);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity 360ms ease, transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

#app ul.is-app-list-visible li {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--app-index, 0) * 24ms);
}

#app ul li a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: var(--app-item-height);
  text-align: center;
  text-decoration: none;
  color: white;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.72), 0 0 14px rgba(0, 0, 0, 0.66), 0 0 22px rgba(255, 255, 255, 0.18);
}

#app .app-link .app-icon {
  width: var(--app-icon-size);
  height: var(--app-icon-size);
  display: block;
  object-fit: contain;
  object-position: center;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 27.4%;
  -webkit-mask: var(--apple-squircle-mask) center / 100% 100% no-repeat;
  mask: var(--apple-squircle-mask) center / 100% 100% no-repeat;
  margin-bottom: 8px;
}

.app-sso-star {
  position: absolute;
  top: -7px;
  left: calc(50% + var(--app-icon-size) / 2 - 18px);
  z-index: 4;
  width: 23px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff8c7;
  background: linear-gradient(145deg, rgba(255, 187, 38, 0.98), rgba(255, 133, 27, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 5px 14px rgba(78, 52, 10, 0.26);
  font-size: 13px;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(109, 63, 0, 0.48);
  pointer-events: none;
}

.app-sso-star[hidden] {
  display: none;
}

.icon-loading-spinner {
  position: absolute;
  top: calc((var(--app-icon-size) - 26px) / 2);
  left: calc(50% - 13px);
  z-index: 3;
  width: 26px;
  height: 26px;
  display: none;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
  animation: icon-loading-spin 780ms linear infinite;
  pointer-events: none;
}

.app-link.is-icon-loading .icon-loading-spinner {
  display: block;
}

.app-list-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.92);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.98);
  transition: opacity 220ms ease, visibility 220ms ease, transform 220ms ease;
}

.app-list-loading.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.app-list-loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: auth-loading-dot 780ms ease-in-out infinite;
}

.app-list-loading span:nth-child(2) {
  animation-delay: 120ms;
}

.app-list-loading span:nth-child(3) {
  animation-delay: 240ms;
}

#app .app-link::before,
#app .app-link::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 1;
  width: var(--app-icon-size);
  height: var(--app-icon-size);
  pointer-events: none;
  border-radius: 27.4%;
  -webkit-clip-path: url(#apple-squircle);
  clip-path: url(#apple-squircle);
  transform: translateX(-50%) translateZ(0);
  backface-visibility: hidden;
}

#app .app-link::before {
  padding: 1.5px;
  box-sizing: border-box;
  background:
    radial-gradient(120% 120% at 0 0, rgba(255, 255, 255, 0.46) 0%, rgba(255, 255, 255, 0.18) 30%, transparent 50%) top left / 56% 56% no-repeat,
    radial-gradient(120% 120% at 100% 100%, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0.14) 32%, transparent 52%) bottom right / 56% 56% no-repeat;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.72;
}

#app .app-link::after {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 34%) top left / 42% 42% no-repeat,
    linear-gradient(315deg, rgba(255, 255, 255, 0.14), transparent 36%) bottom right / 42% 42% no-repeat;
  box-shadow: none;
  opacity: 0.34;
}


@supports (-webkit-hyphens: none) {
  #app .app-link .app-icon,
  #app .app-link::after {
    -webkit-clip-path: none;
    clip-path: none;
    -webkit-mask-image: var(--apple-squircle-mask);
    mask-image: var(--apple-squircle-mask);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
  }

  #app .app-link::before {
    -webkit-clip-path: none;
    clip-path: none;
    -webkit-mask-image: var(--apple-squircle-mask), var(--apple-squircle-mask);
    mask-image: var(--apple-squircle-mask), var(--apple-squircle-mask);
    -webkit-mask-size: 100% 100%, 100% 100%;
    mask-size: 100% 100%, 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-origin: content-box, border-box;
    mask-origin: content-box, border-box;
    -webkit-mask-clip: content-box, border-box;
    mask-clip: content-box, border-box;
  }
}

@keyframes app-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes auth-loading-dot {
  0%,
  80%,
  100% {
    transform: scale(0.72);
    opacity: 0.62;
  }
  40% {
    transform: scale(1.18);
    opacity: 1;
  }
}

@keyframes auth-error-shake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-5px);
  }
  40%,
  60% {
    transform: translateX(5px);
  }
}

#app .app-name {
  display: block;
  width: 100%;
  min-height: 32px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.86), 0 0 12px rgba(0, 0, 0, 0.72), 0 0 22px rgba(255, 255, 255, 0.2);
  line-height: 16px;
  word-break: break-word;
  overflow: visible;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 400;
}

#footer {
  position: fixed;
  bottom: 20px;
  left: 0;
  width: 100%;
  padding: 0 var(--page-x-padding);
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.56);
  text-shadow: 0 1px 8px rgba(17, 24, 39, 0.35);
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-weight: 300;
  line-height: 1.35;
}

#copyright,
.icp-link {
  margin: 0;
  padding: 2px 0;
  max-width: min(46vw, 520px);
  color: inherit;
  overflow-wrap: anywhere;
}

.icp-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.icp-link:hover,
.icp-link:focus-visible {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icp-link:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.5);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 信息按钮样式 */
.info-btn {
  box-sizing: border-box;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.42);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    0 2px 10px rgba(60, 80, 150, 0.18);
  font-size: 8px;
}

.info-btn:hover {
  background: rgba(255, 255, 255, 0.46);
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.52),
    0 2px 10px rgba(60, 80, 150, 0.2);
}

.info-icon {
  color: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  font-weight: bold;
  font-family: inherit;
}

/* 弹窗遮罩层 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 18, 32, 0.24);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* 弹窗内容 */
.modal-content {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(34px) saturate(160%);
  -webkit-backdrop-filter: blur(34px) saturate(160%);
  border-radius: clamp(28px, 8vw, 42px);
  padding: 40px 30px;
  width: min(90%, 420px);
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 18px 46px rgba(16, 24, 48, 0.18);
  transform: translateY(16px) scale(0.985);
  transition: transform 0.3s ease;
}

.modal-content::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 28% 0%, rgba(255, 255, 255, 0.48), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 48%);
  pointer-events: none;
  opacity: 0.72;
}

.modal-content::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.52),
    inset 0 -18px 32px rgba(120, 140, 190, 0.08);
  pointer-events: none;
}

.modal-overlay.show .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 50%;
  color: rgba(31, 41, 55, 0.74);
  background: rgba(255, 255, 255, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 10px 22px rgba(16, 24, 48, 0.12);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.modal-close-button:hover,
.modal-close-button:focus-visible {
  color: rgba(17, 24, 39, 0.92);
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(255, 255, 255, 0.78);
  outline: none;
  transform: translateY(-1px);
}

.modal-close-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.modal-header {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 30px;
}

.modal-header h3 {
  margin: 0;
  color: rgba(31, 41, 55, 0.9);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.modal-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-modal-content {
  width: min(92%, 390px);
  padding: 34px 28px 30px;
}

.login-card-content {
  width: min(88%, 342px);
  min-height: 430px;
  border-radius: 30px;
  padding: 52px 26px 34px;
}

.auth-card-slot {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 2;
  width: 64px;
  height: 8px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.16);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.18), 0 1px 0 rgba(255, 255, 255, 0.52);
  transform: translateX(-50%);
}

.login-card-content .modal-header {
  margin-bottom: 28px;
}

.login-card-content .modal-header h3 {
  font-size: 20px;
}

.login-card-content .auth-form {
  min-height: 292px;
  display: flex;
  flex-direction: column;
}

.login-card-content .auth-submit-btn {
  margin-top: 0;
}

.login-form-actions {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.login-password-help-row {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-initial-password-hint {
  color: rgba(71, 85, 105, 0.62);
  font-size: 12px;
  line-height: 1.5;
}

.auth-link-btn {
  justify-self: end;
  flex: 0 0 auto;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 4px;
  background: transparent;
  color: rgba(0, 92, 204, 0.9);
  font-size: 13px;
  cursor: pointer;
}

.auth-link-btn:hover,
.auth-link-btn:focus-visible {
  color: rgba(0, 76, 180, 0.98);
  text-decoration: underline;
  outline: none;
}

.auth-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
}

.auth-field {
  display: grid;
  gap: 7px;
  color: rgba(55, 65, 81, 0.72);
  font-size: 14px;
  font-weight: 500;
}

.auth-field input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.64);
  color: rgba(31, 41, 55, 0.92);
  font-size: 16px;
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(59, 130, 246, 0.62);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.auth-field input.is-invalid {
  border-color: rgba(220, 38, 38, 0.72);
  background: rgba(254, 242, 242, 0.88);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.auth-field input.is-verified,
.auth-field input:read-only {
  color: rgba(22, 101, 52, 0.96);
  background: rgba(240, 253, 244, 0.82);
  border-color: rgba(34, 197, 94, 0.42);
}

.auth-submit-btn {
  height: 46px;
  border: 0;
  border-radius: 16px;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 122, 255, 0.82);
  box-shadow: 0 12px 24px rgba(0, 98, 204, 0.2);
  cursor: pointer;
}

.auth-submit-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-submit-loading span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: auth-loading-dot 780ms ease-in-out infinite;
}

.auth-submit-loading span:nth-child(2) {
  animation-delay: 120ms;
}

.auth-submit-loading span:nth-child(3) {
  animation-delay: 240ms;
}

.auth-submit-btn.is-loading .auth-submit-label {
  display: none;
}

.auth-submit-btn.is-loading .auth-submit-loading {
  display: inline-flex;
}

.auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-error {
  padding: 10px 12px;
  border: 1px solid rgba(254, 202, 202, 0.78);
  border-radius: 14px;
  color: rgba(127, 29, 29, 0.98);
  background: rgba(254, 226, 226, 0.94);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 10px 20px rgba(127, 29, 29, 0.1);
  font-size: 13px;
}

.auth-error.is-shaking {
  animation: auth-error-shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.auth-error.is-success {
  border-color: rgba(187, 247, 208, 0.82);
  color: rgba(22, 101, 52, 0.98);
  background: rgba(220, 252, 231, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 10px 20px rgba(22, 101, 52, 0.1);
}

.password-reset-modal-content {
  width: min(94%, 430px);
  max-height: min(88vh, 720px);
  overflow-y: auto;
  padding: 34px 28px 28px;
}

.password-reset-form {
  gap: 14px;
}

.password-reset-forgot-fields {
  display: grid;
  gap: 14px;
}

.password-reset-forgot-fields[hidden],
.password-reset-authenticated-fields[hidden] {
  display: none;
}

.masked-mobile-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
  color: rgba(55, 65, 81, 0.66);
  text-align: center;
}

.masked-mobile-card strong {
  color: rgba(31, 41, 55, 0.9);
  font-size: 22px;
  letter-spacing: 0.12em;
  filter: blur(0.2px);
}

.password-reset-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.password-reset-code-row .secondary-btn {
  height: 46px;
  white-space: nowrap;
}

.password-reset-code-row.is-verified .secondary-btn {
  color: rgba(22, 101, 52, 0.72);
  background: rgba(220, 252, 231, 0.78);
}

.password-reset-password-fields {
  display: grid;
  gap: 14px;
}

.password-reset-password-fields[hidden],
#password-reset-verify-code-button[hidden],
#password-reset-submit-button[hidden] {
  display: none;
}

.password-reset-policy {
  margin: -2px 0 0;
  color: rgba(55, 65, 81, 0.62);
  font-size: 12px;
  line-height: 1.5;
}

.pin-modal-content {
  text-align: center;
}

.pin-subtitle {
  margin: 8px 0 0;
  color: rgba(55, 65, 81, 0.66);
  font-size: 13px;
  line-height: 1.5;
}

.pin-account-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.pin-account-list[hidden] {
  display: none;
}

.pin-account-item {
  position: relative;
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 14px;
  padding: 10px 44px 10px 14px;
  background: rgba(255, 255, 255, 0.52);
  color: rgba(31, 41, 55, 0.86);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.pin-account-item:hover {
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(255, 255, 255, 0.64);
  transform: translateY(-1px);
}

.pin-account-item:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  transform: translateY(-1px);
}

.pin-account-item.is-selected {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(255, 255, 255, 0.2) 42%),
    rgba(255, 255, 255, 0.82);
  border-color: rgba(37, 99, 235, 0.56);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 12px 28px rgba(37, 99, 235, 0.14);
  transform: translateY(-1px);
}

.pin-account-item.is-selected::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: rgba(37, 99, 235, 0.78);
}

.pin-account-item.is-selected::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 14px;
  border: solid rgba(37, 99, 235, 0.95);
  border-width: 0 2px 2px 0;
  transform: translateY(-62%) rotate(45deg);
}

.pin-account-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-account-item.is-selected strong {
  color: rgba(17, 24, 39, 0.96);
}

.pin-account-item span {
  color: rgba(55, 65, 81, 0.62);
  font-size: 12px;
}

.pin-account-item.is-selected span {
  color: rgba(30, 64, 175, 0.72);
}

.pin-password-field {
  position: relative;
  z-index: 1;
  margin: 4px 0 14px;
  text-align: left;
}

.pin-password-field[hidden] {
  display: none;
}

.pin-entry {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 8px 0 18px;
}

.pin-entry[hidden] {
  display: none;
}

.pin-password-verify-button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 44px;
  margin: 2px 0 14px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.92), rgba(88, 86, 214, 0.92));
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(0, 122, 255, 0.2);
}

.pin-password-verify-button[hidden] {
  display: none;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 13px;
  outline: none;
  cursor: text;
}

.pin-input {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: transparent !important;
  caret-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  opacity: 0.01 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(209, 213, 219, 0.82);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.56);
}

.pin-dot.is-filled {
  background: rgba(17, 24, 39, 0.88);
}

.pin-dot.is-confirm {
  background: rgba(22, 163, 74, 0.9);
}

.pin-dot.is-error {
  background: rgba(220, 38, 38, 0.92);
}

.pin-loading {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 28px;
  margin: -4px 0 10px;
  color: rgba(37, 99, 235, 0.92);
  font-size: 13px;
  font-weight: 700;
}

.pin-loading[hidden] {
  display: none;
}

.pin-loading .auth-submit-loading {
  display: inline-flex;
  color: currentColor;
}

.pin-modal-content.is-loading .pin-dots {
  cursor: wait;
  opacity: 0.72;
}

.pin-modal-content.is-loading .pin-input {
  pointer-events: none !important;
}

.pin-account-item:disabled,
.pin-login-actions button:disabled,
.pin-reset-button:disabled,
.pin-password-verify-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.pin-login-actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.pin-login-actions[hidden] {
  display: none;
}

.pin-login-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 10px;
  background: transparent;
  color: rgba(41, 101, 190, 0.92);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.pin-login-actions button:hover,
.pin-login-actions button:focus-visible {
  background: rgba(255, 255, 255, 0.52);
  outline: none;
}

.pin-login-actions button + button {
  color: rgba(55, 65, 81, 0.7);
}

.pin-reset-button {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: rgba(0, 122, 255, 0.92);
  cursor: pointer;
}

.pin-reset-button[hidden] {
  display: none;
}

.devices-modal-content {
  width: min(94%, 560px);
  padding: 34px 28px 28px;
}

.devices-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  max-height: min(48vh, 420px);
  overflow-y: auto;
  padding-right: 4px;
}

.device-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  max-height: 260px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  color: rgba(31, 41, 55, 0.88);
  transition: opacity 0.18s ease, transform 0.18s ease, max-height 0.18s ease, padding 0.18s ease, border-color 0.18s ease;
}

.device-item.is-removing {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  opacity: 0;
  transform: translateX(10px);
}

.device-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.device-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.device-title strong {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.device-title span {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.12);
  color: rgba(0, 92, 204, 0.86);
  font-size: 11px;
}

.device-meta,
.devices-empty {
  color: rgba(55, 65, 81, 0.62);
  font-size: 12px;
  line-height: 1.45;
}

.device-meta {
  overflow-wrap: anywhere;
}

.devices-empty {
  padding: 22px 12px;
  text-align: center;
}

.device-revoke-btn,
.danger-btn,
.secondary-btn {
  min-width: 72px;
  height: 38px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.18s ease, opacity 0.18s ease;
}

.device-revoke-btn {
  color: rgba(153, 27, 27, 0.94);
  background: rgba(254, 226, 226, 0.82);
}

.device-revoke-btn:disabled {
  color: rgba(55, 65, 81, 0.5);
  background: rgba(255, 255, 255, 0.52);
  cursor: default;
}

.devices-actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.danger-btn {
  padding: 0 16px;
  color: #fff;
  background: rgba(220, 38, 38, 0.86);
  box-shadow: 0 10px 20px rgba(185, 28, 28, 0.18);
}

.secondary-btn {
  padding: 0 16px;
  color: rgba(31, 41, 55, 0.82);
  background: rgba(255, 255, 255, 0.66);
}

.danger-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.info-item {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  padding: 13px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.34);
  background: transparent;
}

.info-item:last-child {
  border-bottom: 0;
}

.info-label {
  color: rgba(55, 65, 81, 0.68);
  font-size: 14px;
  font-weight: 500;
  min-width: 80px;
}

.info-value {
  color: rgba(31, 41, 55, 0.88);
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

/* 向下滚动指示器 */
#scroll-indicator {
  position: fixed;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#scroll-indicator.show {
  opacity: 1;
}

.flat-v-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: -8px; /* 更紧密重叠 */
  cursor: pointer;
  padding: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.flat-v-container:hover {
  transform: translateY(-1px);
}

.flat-v-top {
  animation: flat-top-bounce 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.1));
  transition: all 0.3s ease;
}

.flat-v-bottom {
  animation: flat-bottom-bounce 1.6s ease-in-out infinite 0.15s;
  filter: drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.12));
  transition: all 0.3s ease;
}

.flat-v-container:hover .flat-v-top {
  stroke: rgba(255, 255, 255, 0.85);
  filter: drop-shadow(0 0.8px 1.5px rgba(0, 0, 0, 0.15));
  animation-play-state: paused;
}

.flat-v-container:hover .flat-v-bottom {
  stroke: rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 0.8px 1.5px rgba(0, 0, 0, 0.18));
  animation-play-state: paused;
}

.flat-v-container:active {
  animation: flat-click-pulse 0.3s ease forwards;
}

@keyframes flat-top-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

@keyframes flat-bottom-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(12px);
  }
}

@keyframes flat-click-pulse {
  0% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(0.95) translateY(2px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

@keyframes smooth-bounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  50% {
    transform: translateY(12px);
    opacity: 1;
  }
}

@media (min-width: 1600px) {
  body {
    --app-item-width: clamp(138px, 6.6vw, 152px);
    --app-item-height: clamp(152px, 7.2vw, 166px);
    --app-icon-size: clamp(96px, 4.6vw, 108px);
    --app-grid-gap: clamp(22px, 1.3vw, 30px);
  }

  #main {
    max-width: min(1800px, calc(100vw - (var(--page-x-padding) * 2)));
  }
}

@media (max-width: 1599px) and (min-width: 1400px) {
  body {
    --app-item-width: 138px;
    --app-item-height: 152px;
    --app-icon-size: 96px;
    --app-grid-gap: 22px;
  }

  #main {
    max-width: min(1360px, calc(100vw - (var(--page-x-padding) * 2)));
  }
}

@media (max-width: 1399px) and (min-width: 1200px) {
  body {
    --app-item-width: 132px;
    --app-item-height: 148px;
    --app-icon-size: 96px;
    --app-grid-gap: 20px;
  }

  #main {
    max-width: min(1180px, calc(100vw - (var(--page-x-padding) * 2)));
  }
}

@media (max-width: 1199px) and (min-width: 992px) {
  body {
    --app-item-width: 130px;
    --app-item-height: 144px;
    --app-icon-size: 92px;
    --app-grid-gap: 20px;
  }

  #main {
    max-width: min(960px, calc(100vw - (var(--page-x-padding) * 2)));
  }
}

@media (max-width: 991px) and (min-width: 768px) {
  body {
    --page-x-padding: 28px;
    --app-item-width: 142px;
    --app-item-height: 154px;
    --app-icon-size: 102px;
    --app-grid-gap: 20px;
  }

  #main {
    max-width: calc(100vw - (var(--page-x-padding) * 2));
  }
}

@media (max-width: 767px) and (min-width: 576px) {
  body {
    --page-x-padding: 20px;
    --app-item-width: 144px;
    --app-item-height: 156px;
    --app-icon-size: 104px;
    --app-grid-gap: 16px;
  }

  #main {
    max-width: calc(100vw - (var(--page-x-padding) * 2));
  }
}

@media (max-width: 575px) {
  body {
    --page-x-padding: 16px;
    --app-item-width: clamp(108px, calc((100vw - 48px) / 2), 140px);
    --app-item-height: clamp(128px, 38vw, 148px);
    --app-icon-size: clamp(78px, 24vw, 96px);
    --app-grid-gap: 14px;
  }

  #wrap {
    padding-top: 118px;
    padding-bottom: 96px;
  }

  #top {
    top: 36px;
  }

  .auth-actions {
    top: 18px;
    right: 16px;
    gap: 8px;
  }

  .auth-round-btn {
    width: 40px;
    height: 40px;
  }

  .auth-round-btn svg {
    width: 21px;
    height: 21px;
  }

  .user-menu {
    top: 0;
    right: 48px;
    width: 176px;
  }

  #app ul {
    grid-template-columns: repeat(2, minmax(0, var(--app-item-width)));
    max-height: min(
      calc(100vh - 206px),
      calc((var(--app-item-height) * 3) + (var(--app-grid-gap) * 2) + (var(--app-grid-edge-padding) * 2))
    );
    max-height: min(
      calc(100dvh - 206px),
      calc((var(--app-item-height) * 3) + (var(--app-grid-gap) * 2) + (var(--app-grid-edge-padding) * 2))
    );
  }

  #app .app-name {
    font-size: 13px;
    line-height: 15px;
  }

  #footer {
    bottom: 14px;
    padding: 0 16px;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 11px;
  }

  #copyright,
  .icp-link {
    max-width: calc(100vw - 72px);
  }

  .devices-modal-content {
    padding: 30px 20px 24px;
  }

  .device-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .device-revoke-btn {
    width: 100%;
  }

  .devices-actions {
    flex-direction: column;
  }

  .danger-btn,
  .secondary-btn {
    width: 100%;
  }

  .ai-drawer {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    --ai-chat-width: 100vw;
    width: 100vw;
    height: auto;
    transform: translateX(calc(100% + 20px));
  }

  .ai-drawer.show {
    transform: translateX(0);
  }

  .ai-drawer-shell,
  .ai-drawer.has-references .ai-drawer-shell {
    width: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .ai-drawer-shell::after {
    border-radius: 0;
  }

  .ai-drawer-header,
  .ai-drawer.has-references .ai-drawer-header {
    width: 100%;
    padding: 18px 18px 12px;
  }

  .ai-drawer-body,
  .ai-drawer.has-references .ai-drawer-body {
    height: calc(100% - 74px);
    padding: 0 14px 24px;
  }

  .ai-chat-panel {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 100%;
  }

  .ai-reference-panel {
    position: fixed;
    top: -1px;
    right: 0;
    bottom: -1px;
    left: 0;
    z-index: 5;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: none;
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    transform: translateX(0);
  }

  .ai-reference-panel::after {
    display: none;
  }

  .ai-reference-panel[hidden] {
    transform: translateX(16px);
  }

  .ai-reference-header {
    min-height: 64px;
    padding: 14px 16px 10px;
  }

  .ai-reference-list {
    max-height: none;
    padding: 10px 16px 24px;
  }

  .ai-reference-detail {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  #ai-reference-close-button {
    width: 40px;
    min-height: 40px;
    padding: 0;
    font-size: 0;
    line-height: 1;
  }

  #ai-reference-close-button::before {
    content: "×";
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
  }

  .ai-message {
    max-width: 92%;
  }
}

@media (max-width: 799px) {
  .ai-drawer {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    --ai-chat-width: 100vw;
    width: 100vw;
    height: auto;
    transform: translateX(calc(100% + 20px));
  }

  .ai-drawer.show {
    transform: translateX(0);
  }

  .ai-drawer-shell,
  .ai-drawer.has-references .ai-drawer-shell {
    width: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .ai-drawer-shell::after {
    border-radius: 0;
  }

  .ai-drawer-header,
  .ai-drawer.has-references .ai-drawer-header {
    width: 100%;
    padding: 18px 18px 12px;
  }

  .ai-drawer-body,
  .ai-drawer.has-references .ai-drawer-body {
    height: calc(100% - 74px);
    padding: 0 14px 24px;
  }

  .ai-chat-panel {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 100%;
  }

  .ai-reference-panel {
    position: fixed;
    top: -1px;
    right: 0;
    bottom: -1px;
    left: 0;
    z-index: 5;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: none;
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    transform: translateX(0);
  }

  .ai-reference-panel::after {
    display: none;
  }

  .ai-reference-panel[hidden] {
    transform: translateX(16px);
  }

  .ai-reference-header {
    min-height: 64px;
    padding: 14px 16px 10px;
  }

  .ai-reference-list {
    max-height: none;
    padding: 10px 16px 24px;
  }

  .ai-reference-detail {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  #ai-reference-close-button {
    width: 40px;
    min-height: 40px;
    padding: 0;
    font-size: 0;
    line-height: 1;
  }

  #ai-reference-close-button::before {
    content: "×";
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
  }
}

@media (max-height: 680px) {
  #wrap {
    padding-top: 108px;
    padding-bottom: 76px;
  }

  #top {
    top: 28px;
  }

  #logo img {
    max-height: 64px;
    margin-bottom: 24px;
  }

  #app ul {
    max-height: calc(100vh - 184px);
    max-height: calc(100dvh - 184px);
  }

  #footer {
    bottom: 12px;
  }

  #scroll-indicator {
    bottom: 42px;
  }
}

#app ul::-webkit-scrollbar {
  display: none;
}

#app ul {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#app ul.is-balanced-layout {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  align-content: center;
  width: var(--app-layout-width, 100%);
  max-width: 100%;
  gap: var(--app-grid-gap);
}

#app ul.is-balanced-layout.is-scroll-layout {
  align-content: flex-start;
}

#app ul.is-balanced-layout li {
  flex: 0 0 var(--app-item-width);
}

@media (prefers-reduced-motion: reduce) {
  #app ul li {
    opacity: 1;
    animation: none;
  }

  .icon-loading-spinner {
    animation: none;
  }

  .auth-round-btn,
  .pin-account-item,
  .modal-content,
  .modal-overlay,
  .ai-drawer,
  .ai-drawer-backdrop,
  .ai-icon-btn,
  .ai-text-btn,
  .ai-reference-panel,
  .ai-reference-toggle,
  .ai-reference-download,
  .ai-send-btn,
  .ai-message {
    transition: none;
  }

  .auth-error.is-shaking,
  .auth-submit-loading span,
  .app-list-loading span,
  .ai-thinking-dots span {
    animation: none;
  }
}
