/*!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", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", Arial, 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: 12px;
  --app-scroll-fade-size: 28px;
  --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;
}

/* The SSO return flow only needs authentication and account recovery dialogs. */
html.sso-login-only #wrap,
html.sso-login-only #top,
html.sso-login-only #footer,
html.sso-login-only #scroll-indicator,
html.sso-login-only #auth-actions,
html.sso-login-only #notification-permissions {
  display: none !important;
}

html.sso-login-only body #wallpaper-background {
  display: block !important;
  opacity: 1;
  background: radial-gradient(ellipse at 25% 30%, #456878, transparent 65%),
    radial-gradient(ellipse at 80% 75%, #394364, #0f172a);
}

html.sso-login-only #wallpaper-background .wallpaper-layer {
  filter: blur(28px) saturate(1.08) !important;
  transition: opacity 300ms ease;
}

#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 1000ms ease-in-out;
}

#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;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.025);
  backface-visibility: hidden;
  transition: opacity 1000ms ease-in-out;
}

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

.wallpaper-layer.is-tiny {
  filter: blur(22px) saturate(1.14) brightness(1.08);
}

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

.wallpaper-layer.is-full {
  z-index: 2;
  filter: blur(22px) saturate(1.14) brightness(1.08);
  transition: opacity 1000ms ease-in-out, filter 1000ms ease-in-out;
}

.wallpaper-layer.is-full.is-active {
  filter: none;
}

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

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

  #app ul li {
    transform: none;
  }
}

.notification-btn { position: relative; }
.notification-badge { position: absolute; top: -4px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border: 2px solid rgba(255,255,255,.9); border-radius: 10px; background: #ff3b30; color: #fff; font-size: 10px; font-weight: 800; line-height: 14px; text-align: center; }
.notification-backdrop { position: fixed; inset: 0; z-index: 1390; background: rgba(13,18,34,.16); opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
.notification-backdrop.show { opacity: 1; pointer-events: auto; }
.notification-drawer { position: fixed; top: 0; right: 0; z-index: 1400; overflow: hidden; display: flex; flex-direction: column; box-sizing: border-box; width: min(448px,100vw); height: 100dvh; padding: 18px 18px 14px 22px; border: 1px solid rgba(255,255,255,.58); border-radius: 32px 0 0 32px; background: rgba(242,246,250,.82); color: rgba(25,34,58,.92); box-shadow: inset 0 1px 1px rgba(255,255,255,.72),0 28px 70px rgba(15,23,42,.28); backdrop-filter: blur(38px) saturate(168%); -webkit-backdrop-filter: blur(38px) saturate(168%); transform: translateX(calc(100% + 24px)); transition: transform 260ms ease; }
.notification-drawer::before,.notification-drawer::after { content: ""; position: absolute; pointer-events: none; }
.notification-drawer::before { inset: 0; background: radial-gradient(circle at 18% 8%,rgba(255,255,255,.78),transparent 30%),radial-gradient(circle at 94% 12%,rgba(132,210,255,.2),transparent 32%),linear-gradient(145deg,rgba(255,255,255,.24),transparent 46%); }
.notification-drawer::after { inset: 1px; border-radius: 31px 0 0 31px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.notification-drawer.is-open { transform: translateX(0); }
.notification-header,.notification-tabs,.notification-archive-filters,.notification-list,.notification-pagination { position: relative; z-index: 2; }
.notification-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 0 2px 2px; }
.notification-header h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: .03em; }
.notification-header p { margin: 3px 0 0; color: rgba(72,86,108,.72); font-size: 13px; }
.notification-close { display: grid; flex: 0 0 auto; width: 40px; height: 40px; padding: 0; place-items: center; border: 1px solid rgba(255,255,255,.54); border-radius: 16px; background: rgba(255,255,255,.4); color: rgba(55,69,94,.76); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.62),0 7px 18px rgba(36,51,78,.09); transition: color 180ms ease,background 180ms ease,transform 180ms ease; }
.notification-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.notification-close:hover,.notification-close:focus-visible { outline: 0; background: rgba(255,255,255,.68); color: #253247; transform: translateY(-1px); }
.notification-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 16px 0 12px; padding: 4px; border: 1px solid rgba(255,255,255,.42); border-radius: 14px; background: rgba(205,216,230,.34); box-shadow: inset 0 1px 0 rgba(255,255,255,.38); }
.notification-tabs button { min-height: 38px; border: 0; border-radius: 10px; padding: 8px 10px; background: transparent; color: rgba(75,89,111,.76); font: inherit; font-weight: 650; cursor: pointer; }
.notification-tabs button.is-active { background: rgba(255,255,255,.66); color: #172033; box-shadow: inset 0 1px 0 rgba(255,255,255,.78),0 5px 16px rgba(31,48,76,.09); }
.notification-archive-filters { z-index: 4; margin: 0 0 12px; padding: 8px; border: 1px solid rgba(255,255,255,.56); border-radius: 18px; background: rgba(255,255,255,.28); box-shadow: inset 0 1px 0 rgba(255,255,255,.58),0 8px 22px rgba(31,48,76,.06); backdrop-filter: blur(20px) saturate(145%); -webkit-backdrop-filter: blur(20px) saturate(145%); }
.notification-search-field { display: flex; align-items: center; gap: 9px; min-height: 43px; padding: 0 12px; border: 1px solid rgba(255,255,255,.66); border-radius: 13px; background: rgba(255,255,255,.48); color: rgba(88,104,128,.68); box-shadow: inset 0 1px 0 rgba(255,255,255,.72); transition: background 180ms ease,border-color 180ms ease,box-shadow 180ms ease; }
.notification-search-field:focus-within { border-color: rgba(61,132,213,.5); background: rgba(255,255,255,.65); box-shadow: inset 0 1px 0 rgba(255,255,255,.82),0 0 0 3px rgba(43,125,214,.1); }
.notification-search-field svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.notification-search-field input { min-width: 0; width: 100%; padding: 10px 0; border: 0; outline: 0; background: transparent; color: #243247; font: inherit; }
.notification-search-field input::-webkit-search-cancel-button { opacity: .55; }
.notification-date-range { position: relative; margin-top: 7px; }
.notification-date-range-button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid rgba(255,255,255,.66); border-radius: 13px; background: rgba(255,255,255,.48); color: #334155; box-shadow: inset 0 1px 0 rgba(255,255,255,.72); font: inherit; text-align: left; cursor: pointer; transition: background 180ms ease,border-color 180ms ease; }
.notification-date-range-button:hover,.notification-date-range-button[aria-expanded="true"] { border-color: rgba(61,132,213,.42); background: rgba(255,255,255,.66); }
.notification-date-range-button svg { width: 18px; height: 18px; fill: none; stroke: rgba(65,82,108,.74); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.notification-date-range-button > span:not(.notification-date-chevron) { flex: 1; }
.notification-date-chevron { color: rgba(76,91,114,.58); font-size: 23px; transform: rotate(90deg); transition: transform 180ms ease; }
.notification-date-range-button[aria-expanded="true"] .notification-date-chevron { transform: rotate(-90deg); }
.notification-date-picker { position: absolute; top: calc(100% + 8px); right: 0; left: 0; z-index: 8; padding: 12px; border: 1px solid rgba(255,255,255,.78); border-radius: 18px; background: rgba(244,248,252,.96); box-shadow: inset 0 1px 0 rgba(255,255,255,.88),0 18px 46px rgba(26,42,68,.2); backdrop-filter: blur(32px) saturate(165%); -webkit-backdrop-filter: blur(32px) saturate(165%); }
.notification-date-picker[hidden] { display: none; }
.notification-calendar-toolbar { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 6px; margin-bottom: 8px; text-align: center; }
.notification-calendar-toolbar button,.notification-calendar-footer button { border: 1px solid rgba(255,255,255,.65); border-radius: 11px; background: rgba(255,255,255,.48); color: #34445b; cursor: pointer; }
.notification-calendar-toolbar button { width: 34px; height: 34px; padding: 0; font-size: 23px; line-height: 1; }
.notification-calendar-toolbar button:hover,.notification-calendar-footer button:hover { background: rgba(255,255,255,.76); }
.notification-calendar-toolbar strong { font-size: 14px; }
.notification-calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.notification-calendar-weekday { padding: 4px 0 6px; color: rgba(83,97,119,.56); font-size: 11px; font-weight: 650; text-align: center; }
.notification-calendar-day { position: relative; min-width: 0; height: 35px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #34445b; font: inherit; font-size: 13px; cursor: pointer; }
.notification-calendar-day:hover { background: rgba(255,255,255,.75); }
.notification-calendar-day.is-in-range { border-radius: 7px; background: rgba(52,132,219,.11); }
.notification-calendar-day.is-selected { border-radius: 11px; background: linear-gradient(145deg,rgba(73,150,231,.97),rgba(39,110,198,.95)); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.32),0 5px 14px rgba(39,110,198,.24); font-weight: 750; }
.notification-calendar-day.is-today:not(.is-selected) { box-shadow: inset 0 0 0 1px rgba(48,121,207,.42); color: #176fc4; font-weight: 750; }
.notification-calendar-day:disabled { color: rgba(89,102,122,.25); cursor: default; }
.notification-calendar-day:disabled:hover { background: transparent; }
.notification-calendar-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(104,122,148,.12); }
.notification-calendar-footer span { color: rgba(73,88,111,.64); font-size: 12px; }
.notification-calendar-footer button { flex: 0 0 auto; padding: 7px 10px; font: inherit; font-size: 12px; font-weight: 700; }
.notification-filter-status { min-height: 0; margin: 7px 4px 1px; color: rgba(77,91,112,.62); font-size: 12px; }
.notification-filter-status:empty { display: none; }
.notification-list { overflow: auto; display: grid; flex: 1 1 auto; min-height: 0; align-content: start; gap: 9px; padding: 2px 3px 2px 2px; }
.notification-item { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 11px; padding: 13px; border: 1px solid rgba(255,255,255,.58); border-radius: 17px; outline: 0; background: rgba(255,255,255,.46); box-shadow: inset 0 1px 0 rgba(255,255,255,.72),0 9px 24px rgba(31,48,76,.07); backdrop-filter: blur(18px) saturate(145%); -webkit-backdrop-filter: blur(18px) saturate(145%); cursor: pointer; transition: border-color 180ms ease,background 180ms ease,box-shadow 180ms ease,transform 180ms ease; }
.notification-item:hover { border-color: rgba(255,255,255,.84); background: rgba(255,255,255,.64); box-shadow: inset 0 1px 0 rgba(255,255,255,.86),0 13px 30px rgba(31,48,76,.12); transform: translateY(-1px); }
.notification-item:focus-visible { border-color: rgba(54,133,218,.52); box-shadow: 0 0 0 3px rgba(40,120,212,.12); }
.notification-item.is-read { opacity: .68; }
.notification-item h3 { overflow: hidden; margin: 0 0 4px; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.notification-item p { display: -webkit-box; overflow: hidden; margin: 0 0 7px; color: rgba(61,76,99,.86); font-size: 13px; line-height: 1.55; white-space: pre-wrap; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.notification-item time { color: rgba(83,98,121,.55); font-size: 11px; }
.notification-marker { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; background: rgba(39,126,226,.12); color: #1677d9; font-weight: 900; }
.severity-important { border-color: rgba(245,158,11,.28); }.severity-important .notification-marker { background: rgba(245,158,11,.14); color: #c87507; }.severity-critical { border-color: rgba(239,68,68,.3); }.severity-critical .notification-marker { background: rgba(239,68,68,.13); color: #d63b3b; font-size: 11px; }
.notification-empty { padding: 72px 20px; color: rgba(83,98,121,.58); text-align: center; }
.notification-pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 2px 1px; color: #64748b; font-size: 12px; }
.notification-pagination button { padding: 7px 12px; border: 1px solid rgba(255,255,255,.65); border-radius: 10px; background: rgba(255,255,255,.48); color: #3d4c61; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); cursor: pointer; }
.notification-pagination button:disabled { opacity: .38; cursor: not-allowed; }
.notification-page-numbers { display: flex; align-items: center; justify-content: center; gap: 3px; min-width: 0; }
.notification-page-numbers button { min-width: 30px; padding: 6px; }
.notification-page-numbers button.is-active { border-color: rgba(40,120,212,.68); background: linear-gradient(145deg,rgba(70,145,225,.94),rgba(35,105,190,.92)); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.28),0 5px 14px rgba(40,120,212,.24); }
.notification-page-numbers span { padding: 0 1px; color: #8290a4; }
.notification-detail { position: fixed; inset: 0; z-index: 2100; display: grid; place-items: center; padding: 24px; background: rgba(15,23,42,.42); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: notification-tip-fade .18s ease-out; }.notification-detail[hidden] { display: none; }
.notification-tip-shell { overflow: hidden; display: flex; flex-direction: column; width: min(720px, 94vw); max-height: min(82dvh, 820px); border: 1px solid rgba(255,255,255,.72); border-radius: 22px; outline: 0; background: rgba(255,255,255,.98); box-shadow: 0 30px 90px rgba(15,23,42,.3); animation: notification-tip-rise .22s cubic-bezier(.2,.8,.2,1); }
.notification-tip-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px 16px; border-bottom: 1px solid #edf1f6; background: linear-gradient(135deg,#f8fbff 0%,#fff 62%); }.notification-tip-header h2 { margin: 3px 0 0; color: #172033; font-size: 20px; }.notification-tip-eyebrow { color: #2878d4; font-size: 11px; font-weight: 800; letter-spacing: .14em; }.notification-tip-close { flex: 0 0 auto; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #edf2f8; color: #526174; font-size: 27px; line-height: 1; cursor: pointer; transition: background .15s ease,transform .15s ease; }.notification-tip-close:hover { background: #e1e9f3; transform: rotate(4deg); }
.notification-tip-content { overflow: auto; padding: 24px; overscroll-behavior: contain; }.notification-detail-card { padding: 0; border: 0; background: transparent; }.notification-detail-card h3 { margin: 10px 0 7px; color: #172033; font-size: clamp(21px,3vw,27px); line-height: 1.3; }.notification-detail-card > time { display: block; margin-bottom: 20px; color: #94a3b8; font-size: 12px; }.notification-detail-severity { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: #eaf3ff; color: #2878d4; font-size: 12px; font-weight: 750; }.notification-detail-card.severity-important .notification-detail-severity { background: #fff3d6; color: #b86600; }.notification-detail-card.severity-critical .notification-detail-severity { background: #fee2e2; color: #c82d2d; }
.notification-detail-error { margin: 18px 0; padding: 34px 20px; border-radius: 14px; background: #f8fafc; color: #718096; text-align: center; }
.notification-rich-content { color: #334155; font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }.notification-rich-content h1,.notification-rich-content h2,.notification-rich-content h3,.notification-rich-content h4 { margin: 1.1em 0 .5em; color: #172033; }.notification-rich-content p { margin: .6em 0; }.notification-rich-content blockquote { margin: 12px 0; padding: 4px 12px; border-left: 3px solid #8bbcf5; background: #f5f9ff; }.notification-rich-content pre { overflow: auto; padding: 12px; border-radius: 10px; background: #172033; color: #eef5ff; }.notification-rich-content img,.notification-rich-content video,.notification-inline-image { display: block; max-width: 100%; height: auto; margin: 12px auto; border-radius: 12px; }.notification-rich-content video { width: 100%; background: #0f172a; }.notification-rich-content table { width: 100%; border-collapse: collapse; }.notification-rich-content th,.notification-rich-content td { padding: 7px; border: 1px solid #dbe3ef; }
.notification-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #e7edf5; }.notification-action { min-width: 88px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; color: #fff; font-weight: 650; text-align: center; text-decoration: none; box-shadow: 0 4px 12px rgba(15,23,42,.09); }.notification-action:hover { filter: brightness(.96); transform: translateY(-1px); }.action-blue { background: #2878d4; }.action-red { background: #d95757; }.action-green { background: #278a62; }.action-purple { background: #7956b8; }.action-black { background: #303846; }.action-white { border-color: #cfd8e5; background: #fff; color: #334155; }
.message-gate { position: fixed; inset: 0; z-index: 2200; display: grid; place-items: center; padding: 20px; background: rgba(13,24,43,.46); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }.message-gate[hidden] { display: none; }.message-gate-card { width: min(390px, 92vw); padding: 34px 28px; border: 1px solid rgba(255,255,255,.65); border-radius: 24px; background: rgba(255,255,255,.93); box-shadow: 0 28px 80px rgba(8,20,42,.28); color: #182235; text-align: center; }.message-gate-card img { max-width: 104px; max-height: 72px; margin: 0 auto 24px; object-fit: contain; }.message-gate-card h2 { margin: 0; font-size: 21px; }.message-gate-card p { margin: 10px 0 24px; color: #718096; }.message-gate-card button { width: 100%; padding: 12px 18px; border: 0; border-radius: 12px; background: #2878d4; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 9px 22px rgba(40,120,212,.24); }
@keyframes notification-tip-fade { from { opacity: 0; } to { opacity: 1; } } @keyframes notification-tip-rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 600px) { .notification-drawer { width: 100vw; padding: 16px 12px max(10px,env(safe-area-inset-bottom)); border-right: 0; border-left: 0; border-radius: 0; }.notification-drawer::after { border-radius: 0; }.notification-header { padding-left: 6px; }.notification-tabs { margin-top: 12px; }.notification-detail { padding: 12px; align-items: end; }.notification-tip-shell { width: 100%; max-height: 88dvh; border-radius: 20px 20px 14px 14px; }.notification-tip-content { padding: 20px; }.notification-actions { display: grid; }.notification-action { width: 100%; box-sizing: border-box; } }

.notification-detail { background: rgba(13,22,38,.24); backdrop-filter: blur(15px) saturate(130%); -webkit-backdrop-filter: blur(15px) saturate(130%); }
.notification-tip-shell { position: relative; border-color: rgba(255,255,255,.64); background: rgba(235,242,249,.72); backdrop-filter: blur(38px) saturate(165%); -webkit-backdrop-filter: blur(38px) saturate(165%); box-shadow: inset 0 1px 0 rgba(255,255,255,.72),0 30px 90px rgba(15,23,42,.3); }
.notification-tip-shell::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 12% 0,rgba(255,255,255,.86),transparent 34%),radial-gradient(circle at 94% 10%,rgba(121,197,255,.2),transparent 34%),linear-gradient(150deg,rgba(255,255,255,.2),transparent 52%); }
.notification-tip-header,.notification-tip-content { position: relative; z-index: 1; }.notification-tip-header { border-bottom-color: rgba(255,255,255,.52); background: rgba(255,255,255,.18); }.notification-tip-close { border: 1px solid rgba(255,255,255,.58); background: rgba(255,255,255,.36); box-shadow: inset 0 1px 0 rgba(255,255,255,.68),0 6px 18px rgba(31,48,76,.09); }
.message-gate { background: rgba(13,22,38,.24); backdrop-filter: blur(20px) saturate(135%); -webkit-backdrop-filter: blur(20px) saturate(135%); }.message-gate-card { position: relative; overflow: hidden; border-color: rgba(255,255,255,.66); background: rgba(235,242,249,.7); backdrop-filter: blur(38px) saturate(165%); -webkit-backdrop-filter: blur(38px) saturate(165%); box-shadow: inset 0 1px 0 rgba(255,255,255,.76),0 28px 80px rgba(8,20,42,.27); }.message-gate-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 15% 0,rgba(255,255,255,.9),transparent 36%),radial-gradient(circle at 95% 18%,rgba(124,201,255,.22),transparent 38%); }.message-gate-card > * { position: relative; z-index: 1; }.message-gate-card img { margin-bottom: 24px; filter: drop-shadow(0 2px 7px rgba(18,25,38,.32)) drop-shadow(0 0 15px rgba(18,25,38,.18)); }.message-gate-card h2 { margin-bottom: 24px; }.message-gate-card button { background: linear-gradient(145deg,rgba(64,143,225,.96),rgba(31,103,190,.94)); box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 9px 22px rgba(40,120,212,.24); }
@media (prefers-reduced-motion: reduce) { .notification-backdrop,.notification-drawer,.notification-detail,.notification-tip-shell { animation: none; transition: none; } }

.auth-actions {
  --auth-top: 28px;
  --auth-right: 30px;
  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);
}

#login-button.is-authenticated[data-gender="0"] {
  color: #3478ad;
  border-color: rgba(157, 206, 243, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 0 0 2px rgba(101, 166, 219, 0.2), 0 12px 26px rgba(21, 32, 62, 0.18);
}

#login-button.is-authenticated[data-gender="1"] {
  color: #9562ba;
  border-color: rgba(215, 183, 235, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 0 0 2px rgba(178, 131, 209, 0.23), 0 12px 26px rgba(21, 32, 62, 0.18);
}

.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[data-gender="0"] #user-menu-name { color: #3478ad; }
#user-menu[data-gender="1"] #user-menu-name { color: #9562ba; }

.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);
  font-size: 0.875rem;
  line-height: 1.4;
  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: 18px 18px 10px 24px;
}

.ai-drawer.has-references .ai-drawer-header {
  width: var(--ai-chat-width);
  margin-left: auto;
  padding: 18px 18px 10px 24px;
  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% - 72px);
  padding: 0 10px 10px;
}

.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: none;
  flex-direction: column;
  min-width: 0;
}

.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-x: auto;
  flex: none;
  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;
  -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 {
  align-self: start;
  color: inherit;
  font-weight: 600;
  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: 10px;
  bottom: 4px;
  width: calc(var(--ai-chat-width) - 20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  user-select: none;
  -webkit-user-select: none;
}

.ai-message-list {
  flex: 1;
  min-height: 0;
  padding: 16px 14px 20px;
  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 {
  position: relative;
  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: -16px;
  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-copy-button {
  position: absolute;
  top: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: rgba(48, 63, 96, 0.68);
  box-shadow: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.86);
  transition: opacity 150ms ease, transform 150ms ease, background 150ms ease, color 150ms ease;
}

.ai-message-copy-button::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(76, 94, 126, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px rgba(31, 46, 76, 0.12);
  transition: border-color 150ms ease, background 150ms ease;
}

.ai-message.assistant .ai-message-copy-button {
  right: -36px;
}

.ai-message.user .ai-message-copy-button {
  left: -36px;
}

.ai-message:hover .ai-message-copy-button,
.ai-message:focus-within .ai-message-copy-button,
.ai-message-copy-button:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.ai-message-copy-button:hover,
.ai-message-copy-button:focus-visible {
  color: #208bdd;
  outline: none;
}

.ai-message-copy-button:hover::before,
.ai-message-copy-button:focus-visible::before {
  border-color: rgba(41, 152, 235, 0.28);
  background: #fff;
}

.ai-message-copy-button svg {
  position: absolute;
  z-index: 1;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 140ms ease, transform 140ms ease;
}

.ai-message-copy-check {
  opacity: 0;
  transform: scale(0.7);
}

.ai-message-copy-button.is-copied {
  color: #15975f;
}

.ai-message-copy-button.is-copied .ai-message-copy-icon {
  opacity: 0;
  transform: scale(0.7);
}

.ai-message-copy-button.is-copied .ai-message-copy-check {
  opacity: 1;
  transform: scale(1);
}

.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: flex;
  align-items: center;
  gap: 10px;
  min-height: 20px;
  margin-top: 8px;
  color: rgba(48, 63, 96, 0.72);
  font-size: 13px;
  line-height: 1.35;
  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 {
  display: flex;
  align-items: center;
  align-self: stretch;
  line-height: inherit;
  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;
  flex: 0 0 auto;
  align-items: center;
  height: 1em;
  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) 76px;
  align-items: stretch;
  gap: 0;
  min-height: clamp(76px, 10vh, 96px);
  margin: 0 6px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(41, 152, 235, 0.42);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ai-message-form:focus-within {
  border-color: rgba(41, 152, 235, 0.62);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(41, 152, 235, 0.08);
}

.ai-message-form textarea {
  width: 100%;
  height: 100%;
  min-height: 74px;
  max-height: 94px;
  resize: none;
  border: 0;
  border-radius: 17px 0 0 17px;
  padding: 8px 14px;
  color: rgba(30, 41, 70, 0.92);
  background: transparent;
  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 {
  box-shadow: none;
}

.ai-send-btn {
  align-self: stretch;
  min-height: 74px;
  margin: 0;
  border: 0;
  border-left: 1px solid rgba(20, 107, 177, 0.48);
  border-radius: 0 17px 17px 0;
  background: #2998eb;
  color: #fff;
  box-shadow: none;
  font-weight: 800;
  transform: none;
}

.ai-send-btn:hover,
.ai-send-btn:focus-visible {
  border-color: transparent;
  border-left-color: rgba(20, 107, 177, 0.62);
  background: #208bdd;
  box-shadow: none;
  transform: none;
}

.ai-send-btn:disabled {
  border-left-color: rgba(41, 152, 235, 0.26);
  background: #8dc8f1;
  color: rgba(255, 255, 255, 0.9);
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.ai-send-btn:disabled:hover,
.ai-send-btn:disabled:focus-visible {
  border-left-color: rgba(41, 152, 235, 0.26);
  background: #8dc8f1;
  transform: none;
}

.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: var(--xiya-scrollbar-size);
  height: var(--xiya-scrollbar-size);
}

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

.ai-think-popover-floating::-webkit-scrollbar-thumb {
  min-width: 32px;
  min-height: 32px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--xiya-scrollbar-thumb);
  background-clip: padding-box;
}

#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-image-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-bottom: 40px;
  vertical-align: top;
}

.wallpaper-switch-indicator {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  width: 36px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(-2px) scaleX(.85);
  transition: opacity 180ms ease, transform 240ms ease;
}

.wallpaper-switch-indicator::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 20px;
  border-radius: inherit;
  background: rgba(255, 255, 255, .92);
  transform: translateX(-22px);
}

body.wallpaper-loading .wallpaper-switch-indicator {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scaleX(1);
}

body.wallpaper-loading .wallpaper-switch-indicator::before {
  animation: wallpaper-switch-glint 1100ms ease-in-out infinite;
}

@keyframes wallpaper-switch-glint {
  to { transform: translateX(38px); }
}

@media (prefers-reduced-motion: reduce) {
  .wallpaper-switch-indicator { transition: none; }
  body.wallpaper-loading .wallpaper-switch-indicator::before { animation: none; transform: translateX(8px); }
}

#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;
  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: 0;
}

#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 - 238px);
  max-height: calc(100dvh - 238px);
  overflow-anchor: none;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--xiya-scrollbar-thumb) transparent;
  justify-content: center;
  justify-items: center;
  align-content: start;
}

html:not([data-browser-compatibility="modern"]) #app.has-overflow-before,
html:not([data-browser-compatibility="modern"]) #app.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.has-overflow-before {
  --app-scroll-fade-top: var(--app-scroll-fade-size);
}

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

#app ul:hover {
  scrollbar-color: var(--xiya-scrollbar-thumb-hover) transparent;
}

/* Webkit scrollbar styling */
#app ul::-webkit-scrollbar {
  width: var(--xiya-scrollbar-size);
  height: var(--xiya-scrollbar-size);
  background: transparent;
}

#app ul::-webkit-scrollbar-track {
  background: transparent;
}

#app ul::-webkit-scrollbar-thumb {
  min-width: 32px;
  min-height: 32px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--xiya-scrollbar-thumb);
  background-clip: padding-box;
  transition: background-color 160ms ease;
}

#app ul::-webkit-scrollbar-thumb:hover {
  background-color: var(--xiya-scrollbar-thumb-hover);
}

/* 默认隐藏滚动条，滚动时短暂显示 */
#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: 1;
  transform: none;
}

#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: 0;
}

/* Transform the complete visual, preserving the image's original squircle. */
.app-icon-visual {
  position: relative;
  display: block;
  flex: none;
  width: var(--app-icon-size);
  height: var(--app-icon-size);
  margin-bottom: 8px;
  transform-origin: center;
}

.app-sso-star {
  position: absolute;
  top: -5px;
  right: -6px;
  z-index: 4;
  width: 25px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 245, 217, .9);
  border-radius: 7px;
  color: #75501d;
  background: linear-gradient(145deg, #fff8e4, #ecd39c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 2px 5px rgba(39, 29, 12, .24);
  text-shadow: none;
  pointer-events: none;
}

.app-sso-star svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.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-link.is-icon-loading .app-icon {
  opacity: .16;
  background: #e4ebf5;
}

#app .app-link .app-icon { transition: opacity 180ms ease; }

.app-link.is-icon-loading .icon-loading-spinner {
  border-color: rgba(54, 95, 153, .24);
  border-top-color: #365f99;
  filter: none;
}

.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;
}

/* These controls stay mounted through their entrance and exit transitions. */
.app-list-loading:not(.show) span,
#scroll-indicator:not(.show) svg,
#pin-modal:not(.show) .pin-dot {
  animation-name: none;
}

#app .app-icon-visual::before,
#app .app-icon-visual::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  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);
}

#app .app-icon-visual::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-icon-visual::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-icon-visual::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-icon-visual::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: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  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: hidden;
  max-height: 32px;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 400;
}

#footer {
  --footer-bottom: 20px;
  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-modal-content.is-pin-setup {
  background-color: rgba(255, 255, 255, 0.86);
}

.is-pin-setup .pin-subtitle {
  color: #374151;
}

.pin-setup-progress {
  margin: 0 0 8px;
  color: #35619b;
  font-size: 13px;
  font-weight: 650;
}

.pin-setup-help {
  margin: 10px 0 0;
  color: #374151;
  font-size: 14px;
  line-height: 1.55;
}

#pin-setup-back {
  min-height: 44px;
  margin-top: 2px;
  font: inherit;
  font-size: 14px;
  color: #245999;
}

.pin-setup-saved {
  position: fixed;
  z-index: 2200;
  bottom: 58px;
  bottom: calc(58px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  border-radius: 12px;
  padding: 10px 18px;
  background: #233b36;
  color: white;
  font-size: 14px;
  pointer-events: none;
}

.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-current {
  background: rgba(169, 210, 254, 0.9);
  animation: pin-current-dot-breathe 920ms ease-in-out infinite;
}

.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-dots.is-policy-warning .pin-dot.is-error {
  animation: pin-policy-dot-warning 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pin-dots.is-policy-warning .pin-dot.is-error:nth-child(2) { animation-delay: 35ms; }
.pin-dots.is-policy-warning .pin-dot.is-error:nth-child(3) { animation-delay: 70ms; }
.pin-dots.is-policy-warning .pin-dot.is-error:nth-child(4) { animation-delay: 105ms; }
.pin-dots.is-policy-warning .pin-dot.is-error:nth-child(5) { animation-delay: 140ms; }
.pin-dots.is-policy-warning .pin-dot.is-error:nth-child(6) { animation-delay: 175ms; }

.auth-error.is-pin-policy-warning {
  border-color: rgba(253, 186, 116, 0.82);
  color: rgba(154, 52, 18, 0.98);
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.98), rgba(254, 226, 226, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 12px 26px rgba(194, 65, 12, 0.12);
}

@keyframes pin-policy-dot-warning {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.26); }
  42% { transform: translateY(-4px) scale(1.18); box-shadow: 0 0 0 7px rgba(220, 38, 38, 0.08); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

@keyframes pin-current-dot-breathe {
  0%, 100% {
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.68), 0 0 8px 2px rgba(79, 148, 248, 0.2);
  }
  50% {
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.74), 0 0 16px 5px rgba(79, 148, 248, 0.33);
  }
}

.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 {
  padding: 0;
  border: 0;
  background: transparent;
  visibility: hidden;
  position: fixed;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.4s;
}

#scroll-indicator.show {
  transition-delay: 0s;
  pointer-events: auto;
  visibility: visible;
  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 {
    --auth-top: 18px;
    --auth-right: 16px;
    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 - 236px),
      calc((var(--app-item-height) * 3) + (var(--app-grid-gap) * 2) + (var(--app-grid-edge-padding) * 2))
    );
    max-height: min(
      calc(100dvh - 236px),
      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 {
    --footer-bottom: 14px;
    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%;
  }

}

@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: 16px 14px 8px 18px;
  }

  .ai-drawer-body,
  .ai-drawer.has-references .ai-drawer-body {
    height: calc(100% - 66px);
    padding: 0 8px max(8px, env(safe-area-inset-bottom));
  }

  .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;
  }
  .logo-image-wrap { margin-bottom: 24px; }

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

  #footer {
    --footer-bottom: 12px;
    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,
  .pin-dot.is-current,
  .pin-dots.is-policy-warning .pin-dot.is-error,
  .auth-submit-loading span,
  .app-list-loading span,
  .ai-thinking-dots span {
    animation: none;
  }
}

/* 桌面通知授权失败后的引导，靠近消息入口。 */
.notification-permissions {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 1100;
  width: min(360px, calc(100vw - 2 * var(--auth-right)));
  box-sizing: border-box;
  padding: 16px 40px 16px 16px;
  border-radius: 14px;
  background: #fff;
  color: #25324a;
  box-shadow: 0 6px 30px rgba(0, 0, 0, .18);
  font-size: 14px;
  line-height: 1.6;
}
.notification-permissions::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 17px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
}
.notification-permissions[hidden] { display: none; }
.notification-permissions button {
  display: block;
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  padding: 7px 14px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}
.notification-permissions button[hidden] { display: none; }
.notification-permissions button:disabled { opacity: .6; cursor: wait; }
.notification-permissions .notification-permission-close {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  background: transparent;
  color: #64748b;
  font-size: 22px;
  line-height: 1;
}
@media (max-width: 600px) {
  .notification-permissions { width: min(360px, calc(100vw - 2 * max(var(--auth-right), env(safe-area-inset-right)))); }
  .notification-permissions::before { right: 14px; }
}

/* Shared, restrained surfaces for the two utility drawers. */
.notification-drawer,
.ai-drawer-shell {
  border-color: rgba(255, 255, 255, .82);
  background: #f5f7fb;
  color: #1c2a40;
  box-shadow: -18px 0 56px rgba(12, 27, 49, .18), inset 1px 0 rgba(255, 255, 255, .9);
}

.notification-drawer::before,
.ai-drawer-shell::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 185px);
}

.notification-drawer::after,
.ai-drawer-shell::after { box-shadow: none; }

.notification-backdrop,
.ai-drawer-backdrop { background: rgba(15, 26, 45, .28); }

.notification-drawer,
.ai-drawer { --ai-slide-duration: 320ms; transition: transform var(--ai-slide-duration) cubic-bezier(.22, 1, .36, 1); }

.notification-header h2,
.ai-drawer-header h2 { color: #1c2a40; letter-spacing: .015em; }

.notification-header p { color: #69788c; }

.notification-close,
.ai-icon-btn { border-color: #dfe5ef; background: #fff; color: #52647d; box-shadow: 0 2px 8px rgba(27, 48, 78, .04); }

.notification-close:hover,
.notification-close:focus-visible,
.ai-icon-btn:hover,
.ai-icon-btn:focus-visible { border-color: #b8c9df; background: #eef3f9; color: #284d80; }

.notification-close:focus-visible,
.ai-icon-btn:focus-visible,
.notification-tabs button:focus-visible,
.notification-pagination button:focus-visible,
.ai-send-btn:focus-visible { outline: 2px solid #456ba4; outline-offset: 2px; }

.notification-tabs { border-color: #e1e7f0; background: #e9eef5; box-shadow: none; }
.notification-tabs button { color: #607088; transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease; }
.notification-tabs button.is-active { background: #fff; color: #264e84; box-shadow: 0 2px 8px rgba(31, 52, 82, .09); }

.notification-archive-filters { border-color: #e2e8f1; background: #fff; box-shadow: 0 5px 18px rgba(29, 49, 77, .04); }
.notification-search-field,
.notification-date-range-button { border-color: #e0e7f0; background: #f8fafd; box-shadow: none; }
.notification-search-field:focus-within,
.notification-date-range-button[aria-expanded="true"] { border-color: #95add0; background: #fff; box-shadow: 0 0 0 3px rgba(52, 91, 151, .1); }
.notification-date-picker { border-color: #dae4f0; background: #fff; box-shadow: 0 18px 42px rgba(23, 42, 69, .18); }

.notification-item { border-color: #e1e7ef; background: #fff; box-shadow: 0 4px 16px rgba(27, 47, 75, .05); backdrop-filter: none; -webkit-backdrop-filter: none; }
.notification-item:hover { border-color: #b5c9e4; background: #fff; box-shadow: 0 9px 24px rgba(27, 47, 75, .11); transform: translateY(-2px); }
.notification-item.is-read { opacity: 1; background: #f8fafd; }
.notification-item.is-read h3 { color: #617086; font-weight: 650; }
.notification-item h3 { color: #213149; }
.notification-item p { color: #596b81; }
.notification-item time { color: #75849a; }
.notification-marker { background: #eaf1fa; color: #365f99; }
.notification-item:not(.is-read) { box-shadow: inset 3px 0 #4a74ae, 0 4px 16px rgba(27, 47, 75, .05); }
.notification-item.severity-important { border-color: #edddbd; }
.notification-item.severity-important:not(.is-read) { box-shadow: inset 3px 0 #c28a35, 0 4px 16px rgba(27, 47, 75, .05); }
.notification-item.severity-critical { border-color: #efcdcd; }
.notification-item.severity-critical:not(.is-read) { box-shadow: inset 3px 0 #c65c5c, 0 4px 16px rgba(27, 47, 75, .05); }
.notification-pagination button { border-color: #dfe6ef; background: #fff; color: #405571; box-shadow: none; transition: background 180ms ease, border-color 180ms ease; }
.notification-pagination button:not(:disabled):hover { border-color: #b5c9e4; background: #eef3f9; }
.notification-page-numbers button.is-active { border-color: #365f99; background: #365f99; box-shadow: none; }

.notification-detail { background: rgba(15, 26, 45, .32); }
.notification-tip-shell { border-color: #e2e8f1; background: #f8fafd; box-shadow: 0 28px 80px rgba(13, 29, 52, .24); backdrop-filter: none; -webkit-backdrop-filter: none; }
.notification-tip-shell::before { display: none; }
.notification-tip-header { border-bottom-color: #e3e9f1; background: #fff; }
.notification-tip-eyebrow { color: #365f99; }
.notification-tip-close { border-color: #dfe6ef; background: #f5f8fc; }
.notification-tip-close:hover { background: #eaf1fa; transform: none; }
.notification-detail-severity { background: #eaf1fa; color: #365f99; }
.action-blue,
.message-gate-card button { background: #365f99; }
.message-gate-card { border-color: #e1e7ef; background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
.message-gate-card::before { display: none; }

/* A reading column and an independent source reader share one window. */
.ai-drawer {
  --ai-chat-width: clamp(412px, 43vw, 590px);
  --ai-gutter: clamp(18px, 2.3vw, 34px);
  --ai-radius: 22px;
  --ai-ink: #1d2027; --ai-muted: #585e6b; --ai-accent: #075dbd;
  --ai-canvas: #fafafc; --ai-surface: #fff; --ai-line: #d9dbe2;
  --ai-soft: #eef2f8; --ai-link: #145da9; --ai-accent-soft: #e8f0fc;
  --frost-rgb: 250, 250, 252;
  top: max(16px, calc((100dvh - 846px) / 2));
  bottom: max(16px, calc((100dvh - 846px) / 2));
  right: 16px; width: min(1136px, calc(100vw - 32px)); color: var(--ai-ink);
}
.ai-drawer[hidden], .ai-drawer-backdrop[hidden], .ai-access-cover[hidden], #ai-resume[hidden] { display: none; }
.ai-drawer-backdrop { background: rgba(16,19,32,.24); }
.ai-drawer-shell {
  display: flex; flex-direction: column; border: 0; border-radius: var(--ai-radius);
  background: var(--ai-canvas); color: var(--ai-ink);
  box-shadow: 0 14px 52px rgba(14,19,32,.22), 0 2px 9px rgba(14,19,32,.12);
}
.ai-drawer-shell::before { display: none; }
.ai-drawer-shell::after {
  inset: 0; z-index: 7; border: 1px solid var(--ai-line); border-radius: inherit;
}
.ai-border-beam {
  --beam-duration: 3.3s;
  display: none;
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  border-radius: inherit;
  filter: drop-shadow(0 0 2px rgba(99, 141, 255, .85));
}
/* Mask the moving lights first. Their soft halo is then clipped by the shell. */
.ai-beam-rim {
  position: absolute;
  inset: 0;
  padding: 3.5px;
  border-radius: inherit;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.ai-beam-rim > span {
  position: absolute;
  inset: 0 auto auto 0;
  opacity: 0;
  offset-path: inset(1.75px round max(8px, calc(var(--ai-radius) - 1.75px)));
  offset-anchor: center;
  offset-rotate: 0deg;
}
.ai-beam-trail {
  --beam-lag: 52px;
  width: 184px;
  height: 184px;
  background: radial-gradient(closest-side, #9780ff 0%, #967cfa 32%, rgba(142,117,252,.64) 61%, rgba(142,117,252,.16) 84%, transparent);
}
.ai-beam-tip {
  --beam-lag: 0px;
  width: 96px;
  height: 96px;
  background: radial-gradient(closest-side, #f5ffff 0%, #aceeff 17%, #419fff 42%, rgba(69,126,255,.78) 62%, rgba(69,126,255,.20) 84%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  @supports (offset-path: inset(1px round 1px)) and (mask-composite: exclude) {
    .ai-drawer.show .ai-border-beam { display: block; }
    .ai-drawer.show .ai-beam-rim > span {
      animation: ai-beam-orbit var(--beam-duration) cubic-bezier(.38,.14,.55,.88) var(--ai-slide-duration) 1,
        ai-beam-fade var(--beam-duration) ease-in-out var(--ai-slide-duration) 1;
    }
  }
  .ai-drawer-shell { transition: width 260ms cubic-bezier(.22,1,.36,1); }
}
/* A single easing curve and a fixed trail distance keep the light continuous
   around corners, independently of its brightness and final taper. */
@keyframes ai-beam-orbit {
  from { offset-distance: calc(0% - var(--beam-lag)); }
  to { offset-distance: calc(150% - var(--beam-lag)); }
}
@keyframes ai-beam-fade {
  from { opacity: 0; transform: scale(.3); }
  8%, 91% { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(.04); }
}

/* Widen the turn into each flat edge, like the app icon curves. Keep the
   outline, illuminated rim and the center of the motion path aligned. */
@supports (clip-path: shape(from 0 0, line to 100% 0, close)) and
          (offset-path: shape(from 0 0, line to 100% 0, close)) {
  .ai-drawer {
    --ai-corner: 34px;
    --ai-tangent: calc(var(--ai-corner) * .17);
    --ai-opposite: calc(100% - var(--ai-corner));
    --ai-far-tangent: calc(100% - var(--ai-tangent));
    --ai-contour: from var(--ai-corner) 0,
      line to var(--ai-opposite) 0,
      curve to 100% var(--ai-corner) with var(--ai-far-tangent) 0 / 100% var(--ai-tangent),
      line to 100% var(--ai-opposite),
      curve to var(--ai-opposite) 100% with 100% var(--ai-far-tangent) / var(--ai-far-tangent) 100%,
      line to var(--ai-corner) 100%,
      curve to 0 var(--ai-opposite) with var(--ai-tangent) 100% / 0 var(--ai-far-tangent),
      line to 0 var(--ai-corner),
      curve to var(--ai-corner) 0 with 0 var(--ai-tangent) / var(--ai-tangent) 0,
      close;
    filter: drop-shadow(0 9px 21px rgba(14,19,32,.24)) drop-shadow(0 2px 4px rgba(14,19,32,.12));
  }
  .ai-drawer-shell {
    border-radius: 0;
    clip-path: shape(var(--ai-contour));
    box-shadow: none;
  }
  .ai-drawer-shell::after, .ai-beam-rim {
    --ai-inner-edge: calc(100% - var(--ai-rim-width));
    /* Trace the inner contour in the opposite direction to leave it open. */
    clip-path: shape(var(--ai-contour),
      move to var(--ai-corner) var(--ai-rim-width),
      curve to var(--ai-rim-width) var(--ai-corner) with var(--ai-tangent) var(--ai-rim-width) / var(--ai-rim-width) var(--ai-tangent),
      line to var(--ai-rim-width) var(--ai-opposite),
      curve to var(--ai-corner) var(--ai-inner-edge) with var(--ai-rim-width) var(--ai-far-tangent) / var(--ai-tangent) var(--ai-inner-edge),
      line to var(--ai-opposite) var(--ai-inner-edge),
      curve to var(--ai-inner-edge) var(--ai-opposite) with var(--ai-far-tangent) var(--ai-inner-edge) / var(--ai-inner-edge) var(--ai-far-tangent),
      line to var(--ai-inner-edge) var(--ai-corner),
      curve to var(--ai-opposite) var(--ai-rim-width) with var(--ai-inner-edge) var(--ai-tangent) / var(--ai-far-tangent) var(--ai-rim-width),
      close);
  }
  .ai-drawer-shell::after { --ai-rim-width: 1px; border: 0; background: var(--ai-line); }
  .ai-beam-rim { --ai-rim-width: 3.5px; padding: 0; mask: none; }
  .ai-beam-rim > span {
    --beam-edge: 1.75px;
    --beam-far-edge: calc(100% - var(--beam-edge));
    offset-path: shape(from var(--ai-corner) var(--beam-edge),
      line to var(--ai-opposite) var(--beam-edge),
      curve to var(--beam-far-edge) var(--ai-corner) with var(--ai-far-tangent) var(--beam-edge) / var(--beam-far-edge) var(--ai-tangent),
      line to var(--beam-far-edge) var(--ai-opposite),
      curve to var(--ai-opposite) var(--beam-far-edge) with var(--beam-far-edge) var(--ai-far-tangent) / var(--ai-far-tangent) var(--beam-far-edge),
      line to var(--ai-corner) var(--beam-far-edge),
      curve to var(--beam-edge) var(--ai-opposite) with var(--ai-tangent) var(--beam-far-edge) / var(--beam-edge) var(--ai-far-tangent),
      line to var(--beam-edge) var(--ai-corner),
      curve to var(--ai-corner) var(--beam-edge) with var(--beam-edge) var(--ai-tangent) / var(--ai-tangent) var(--beam-edge),
      close);
  }
}
.ai-drawer .ai-drawer-body { flex: 1; display: flex; min-height: 0; height: 100%; padding: 0; }
.ai-chat-panel {
  position: relative; inset: auto; flex: 0 0 var(--ai-chat-width); width: var(--ai-chat-width);
  max-width: 100%; height: 100%; margin-left: auto;
}
.ai-drawer .ai-drawer-header {
  flex: none; width: 100%; margin: 0; padding: 15px var(--ai-gutter) 12px;
  box-sizing: border-box; background: transparent;
}
.ai-drawer-header h2 { gap: 10px; color: var(--ai-ink); font-size: 19px; font-weight: 650; letter-spacing: -.025em; }
.ai-brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--ai-link); background: var(--ai-accent-soft); }
.ai-brand-mark svg { width: 21px; height: 21px; fill: currentColor; }
.ai-drawer-actions { gap: 4px; }
.ai-icon-btn { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--ai-muted); }
.ai-icon-btn svg { width: 19px; height: 19px; }
.ai-icon-btn:hover, .ai-icon-btn:focus-visible { color: var(--ai-ink); background: var(--ai-soft); transform: none; }
.ai-drawer :is(button,a):focus-visible { outline: 2px solid var(--ai-link); outline-offset: 2px; }
.ai-message-list {
  --frost-pad-start: 18px; --frost-pad-end: 18px; padding: 18px var(--ai-gutter); gap: 26px;
  overscroll-behavior: contain;
}
.ai-message-group { flex: none; min-width: 0; gap: 15px; }
.ai-message { font-size: 16px; }
.ai-message.user, .ai-message.user.is-sticky-question.is-stuck {
  max-width: calc(100% - 44px); padding: 9px 15px; border: 0; border-radius: 18px 18px 6px 18px;
  background: var(--ai-accent-soft); color: var(--ai-ink); line-height: 1.5; box-shadow: none;
}
.ai-message.user.is-sticky-question { top: calc(-1 * var(--frost-pad-start, 18px)); }
.ai-message.assistant {
  width: 100%; max-width: 100%; min-width: 0; padding: 0; display: flex; flex-direction: column;
  align-items: flex-start; background: transparent; color: var(--ai-ink); border: 0; border-radius: 0; box-shadow: none;
  line-height: 1.72;
}
.ai-message.assistant .ai-message-content { max-width: 100%; min-width: 0; }
.ai-message-content > :first-child { margin-top: 0; }
.ai-message-content > :last-child { margin-bottom: 0; }
.ai-message-content :is(h1,h2,h3,strong), .ai-reference-detail .ai-reference-content :is(h1,h2,h3,strong,figcaption) { color: var(--ai-ink); }
.ai-message-content :is(a, .ai-inline-reference), .ai-drawer .ai-reference-content a { color: var(--ai-link); }
.ai-message-content pre, .ai-reference-content pre { max-width: 100%; overflow-x: auto; }
.ai-message.assistant .ai-message-copy-button {
  order: 2; position: relative; inset: auto; width: 36px; height: 34px; margin: 1px 0 0 -7px;
  transform: none; color: var(--ai-muted); background: transparent; border-radius: 8px;
}
.ai-message-copy-button::before { display: none; }
.ai-message-copy-button:focus-visible, .ai-message-copy-button:hover { color: var(--ai-link); }
.ai-message.assistant .ai-message-copy-button:hover { background: var(--ai-soft); }
.ai-message.failed { color: #9a332e; }
.ai-message.assistant:has(.ai-message-streaming:not([hidden]),.ai-message-thinking:not([hidden])) .ai-message-copy-button { display: none; }

.ai-welcome {
  flex: none; align-self: center; width: min(100%, 396px); margin: auto; padding: 12px 0 20px;
  display: flex; flex-direction: column; align-items: flex-start; text-align: left; color: var(--ai-ink);
}
.ai-welcome h3 { margin: 20px 0 22px; font-size: clamp(29px,3vw,39px); line-height: 1.2; letter-spacing: -.045em; font-weight: 650; }
.ai-welcome-orbit { position: relative; width: 92px; height: 76px; }
.ai-welcome-orbit i {
  position: absolute; display: block; width: 76px; height: 63px; border-radius: 53% 49% 50% 54%;
  background: conic-gradient(from 125deg, #8b76de, #6d9bf8 18%, #bde4fa 33%, #ececfe 46%, #9188e4 65%, #5369c9 83%, #c7a3ed);
  -webkit-mask-image: radial-gradient(ellipse 48% 44% at 48% 44%, transparent 63%, #000 66%);
  mask-image: radial-gradient(ellipse 48% 44% at 48% 44%, transparent 63%, #000 66%);
  transform: rotate(-31deg) skewX(-11deg); top: 8px; left: 2px;
}
.ai-welcome-orbit i+i {
  top: 7px; left: 18px; width: 55px; height: 68px; transform: rotate(42deg);
  background: conic-gradient(from 50deg, #879cfa, #daefff 22%, #7397ed 46%, #a792e3 72%, #e1c9f5 85%, #879cfa);
}
.ai-welcome-orbit svg { position: absolute; top: 0; right: 0; width: 17px; height: 17px; fill: #8589ce; }
.ai-starters { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-starters button, #ai-resume {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 13px;
  border-radius: 12px; border: 1px solid var(--ai-line); background: var(--ai-surface); color: var(--ai-ink);
  font: inherit; font-size: 14px; line-height: 1.3; cursor: pointer;
}
.ai-starters svg { width: 17px; height: 17px; color: var(--ai-link); fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.ai-starters button:hover, #ai-resume:hover { background: var(--ai-soft); border-color: var(--ai-link); }
.ai-message-references { margin: 6px 0 0; gap: 4px; max-width: 100%; }
.ai-message-references-summary {
  justify-self: start; gap: 9px; min-height: 34px; padding: 4px 0; border: 0;
  background: transparent; color: var(--ai-link); font-size: 14px; font-weight: 550;
}
.ai-message-references-summary:hover, .ai-message-references-summary:focus-visible { background: transparent; color: var(--ai-ink); transform: none; }
.ai-message-references-summary::after, .ai-message-references.expanded .ai-message-references-summary::after {
  content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg);
}
.ai-message-references.expanded .ai-message-references-summary::after { transform: translateY(2px) rotate(225deg); }
.ai-message-references-list { gap: 3px; }
.ai-reference-toggle, .ai-suggested-question-button {
  min-width: 0; min-height: 38px; padding: 8px 11px; background: var(--ai-soft); color: var(--ai-ink);
  border: 0; border-radius: 10px; font-size: 14px; font-weight: 500;
}
.ai-reference-toggle span { white-space: normal; overflow-wrap: anywhere; }
.ai-reference-toggle:hover, .ai-suggested-question-button:hover { background: var(--ai-accent-soft); color: var(--ai-link); }
.ai-composer-dock { flex: none; padding: 6px var(--ai-gutter) 18px; }
.ai-message-form {
  display: flex; flex-direction: row; align-items: flex-end; gap: 8px;
  min-height: 0; padding: 6px 7px 6px 15px; margin: 0; overflow: visible;
  border: 1px solid var(--ai-line); border-radius: 23px; background: var(--ai-surface);
  box-shadow: 0 2px 6px rgba(22,29,44,.06);
}
.ai-message-form:focus-within { border-color: #79a0d4; box-shadow: 0 0 0 2px rgba(58,119,201,.09); }
.ai-message-form textarea {
  field-sizing: content; min-width: 0; width: auto; flex: 1 1 0%; align-self: center; height: auto; min-height: 30px; max-height: min(136px,25dvh);
  margin: 0; padding: 4px 0; color: var(--ai-ink); border: 0; border-radius: 0; background: transparent;
  font: inherit; font-size: 16px; line-height: 1.45; resize: none; overflow-y: auto;
}
.ai-message-form textarea::placeholder { color: var(--ai-muted); text-align: left; font-size: 16px; }
.ai-send-btn {
  position: relative; display: grid; place-items: center; align-self: flex-end; flex: none;
  width: 36px; height: 36px; min-height: 36px; padding: 0; border: 0; border-radius: 50%;
  color: white; background: var(--ai-accent); transform: none;
}
.ai-send-btn svg { width: 21px; height: 21px; }
.ai-send-btn:hover, .ai-send-btn:focus-visible { background: #0756af; transform: none; }
.ai-send-btn:disabled, .ai-send-btn:disabled:hover { color: var(--ai-muted); background: var(--ai-soft); }
.ai-send-btn.is-streaming svg { visibility: hidden; }
.ai-send-btn.is-streaming::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px dotted currentColor; border-radius: 50%; }
.ai-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ai-reference-panel {
  inset: 0 var(--ai-chat-width) 0 0; padding: 0; border: 0; border-right: 1px solid var(--ai-line);
  overflow: hidden; background: var(--ai-surface); --frost-rgb: 255,255,255;
}
.ai-reference-panel::after { display: none; }
.ai-reference-header { flex: none; min-height: 64px; padding: 12px 20px; color: var(--ai-ink); }
.ai-reference-list { padding: 12px 20px 22px; --frost-pad-start: 12px; --frost-pad-end: 22px; }
.ai-reference-detail.active { padding: 0; color: var(--ai-ink); border: 0; background: transparent; border-radius: 0; }
.ai-reference-detail .ai-reference-content { padding-top: 8px; font-size: 15px; color: var(--ai-ink); }
.ai-reference-download, .ai-text-btn { min-height: 36px; border: 0; color: var(--ai-link); background: var(--ai-soft); font-size: 14px; }
.ai-access-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.ai-access-cover h3 { margin: 0; color: var(--ai-ink); font-size: 22px; }
#ai-cover-close { position: absolute; top: 14px; right: 14px; }
.ai-covered .ai-drawer-body { visibility: hidden; }
.ai-access-cover + .ai-drawer-body { z-index: 1; }
.ai-access-cover { z-index: 4; }
@media (prefers-color-scheme: dark) {
  .ai-drawer {
    color-scheme: dark; --ai-ink: #f2f3f7; --ai-muted: #b4b9c4; --ai-canvas: #222328; --ai-surface: #2c2d33;
    --ai-line: #42454f; --ai-soft: #353740; --ai-accent: #1768c9; --ai-link: #a8caff;
    --ai-accent-soft: #2c405b; --frost-rgb: 34,35,40;
  }
  .ai-reference-panel { --frost-rgb: 44,45,51; }
  .ai-message.failed { color: #ffc3bc; }
  .ai-drawer .ai-reference-content :is(table,th,td,blockquote,code), .ai-drawer .ai-message-content :is(blockquote,code) { background: var(--ai-soft); color: var(--ai-ink); border-color: var(--ai-line); }
  .ai-drawer :is(.ai-structured-reference-heading,.ai-reference-detail-section-content,.ai-reference-detail-section-title,.ai-bubble-loading,.ai-suggested-questions-title) { color: var(--ai-muted); }
  .ai-drawer :is(.ai-inline-reference,.ai-think-badge,.ai-reference-detail-count) { color: var(--ai-link); background: var(--ai-accent-soft); }
}
@media (max-width: 799px) {
  .ai-drawer { --ai-radius: 16px; --ai-corner: 22px; --ai-chat-width: 100%; --ai-gutter: max(18px,env(safe-area-inset-left),env(safe-area-inset-right)); inset: var(--home-visible-top,0px) 0 auto; width: 100%; height: 100%; height: var(--home-visible-height,100dvh); }
  .ai-drawer .ai-drawer-header { padding: max(9px,env(safe-area-inset-top)) var(--ai-gutter) 8px; }
  .ai-reference-panel { position: absolute; inset: 0; z-index: 6; border: 0; }
  .ai-reference-header { padding-top: max(10px,env(safe-area-inset-top)); }
  .ai-reference-list { --frost-pad-end: max(22px,env(safe-area-inset-bottom)); }
  .ai-composer-dock { padding-bottom: max(12px,env(safe-area-inset-bottom)); }
  .ai-welcome { width: min(100%,340px); }
}
@media (pointer: coarse) {
  /* Composite the decorative rim separately from the editable text and icon. */
  .ai-drawer { filter: none; }
  .ai-drawer.show { transform: none; }
  .ai-drawer .ai-drawer-shell { clip-path: none; border-radius: var(--ai-radius); }
  .ai-drawer .ai-message-form textarea { background: var(--ai-surface); }
  .ai-icon-btn, .ai-send-btn { min-width: 44px; min-height: 44px; }
  .ai-message.assistant .ai-message-copy-button { opacity: 1; pointer-events: auto; width: 44px; height: 44px; }
  .ai-starters button, .ai-reference-toggle, .ai-message-references-summary { min-height: 44px; }
}
@media (max-height: 510px) {
  .ai-drawer .ai-drawer-header { padding-block: 4px; }
  .ai-welcome { padding-block: 4px; }
  .ai-welcome-orbit { display: none; }
  .ai-welcome h3 { margin: 4px 0 12px; font-size: 25px; }
  .ai-composer-dock { padding-bottom: max(6px,env(safe-area-inset-bottom)); }
}
@media (forced-colors: active) {
  .ai-drawer.show .ai-border-beam, .ai-welcome-orbit { display: none; }
  .ai-drawer-shell { clip-path: none; border-radius: var(--ai-radius); }
  .ai-message-form, .ai-drawer-shell { border: 1px solid CanvasText; }
}

@keyframes drawer-content-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (hover: hover) and (pointer: fine) {
  #app .app-icon-visual { transition: transform 220ms cubic-bezier(.22, 1, .36, 1); }
  #app .app-link:hover .app-icon-visual,
  #app .app-link:focus-visible .app-icon-visual { transform: translateY(-4px) scale(1.035); }
  #app .app-link:active .app-icon-visual { transform: translateY(-1px) scale(.985); }
  .notification-drawer.is-open .notification-item { animation: drawer-content-enter 240ms cubic-bezier(.22, 1, .36, 1) both; }
}

@media (prefers-reduced-motion: reduce) {
  .notification-drawer,
  .ai-drawer,
  .notification-tabs button,
  .notification-item,
  .notification-pagination button,
  .ai-message-form,
  .ai-suggested-question-button,
  .ai-message-group,
  #app .app-link .app-icon,
  #app .app-icon-visual,
  .notification-drawer.is-open .notification-item { animation: none; transition: none; }
}

/* All progressive frost layers sample the same rectangle. */
.edge-material {
  --edge-direction: to bottom;
  --edge-rgb: 15, 23, 42;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  display: block;
  pointer-events: none;
}
.edge-material:not(.progressive-material) > span { display: none; }
.edge-material::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--edge-direction), rgba(var(--edge-rgb), .28), rgba(var(--edge-rgb), .1) 45%, rgba(var(--edge-rgb), 0));
}
/* The common material stylesheet supplies the five filtered layers. The
   homepage keeps its wallpaper tint and its lighter touch-device budget. */
.edge-material.progressive-material { --material-direction: var(--edge-direction); }
.edge-material.progressive-material::after { background: linear-gradient(var(--edge-direction), rgba(var(--edge-rgb), .28), rgba(var(--edge-rgb), .1) 45%, transparent); }
#app .edge-material::after { background: none; }
/* Wherever the catalogue scrolls, fade the icons and their blur together into
   the wallpaper. The outer mask also isolates the wallpaper from these filters. */
:where(.xiya-modern-mode) #app:where(.has-overflow-before, .has-overflow-after) {
  --fade-top: calc(var(--app-edge-before, 0px) * 1.5);
  --fade-bottom: calc(var(--app-edge-after, 0px) * 1.5);
  --catalogue-mask: linear-gradient(to bottom,
    transparent, rgba(0,0,0,.18) calc(var(--fade-top) * .28),
    rgba(0,0,0,.82) calc(var(--fade-top) * .72), #000 var(--fade-top),
    #000 calc(100% - var(--fade-bottom)), rgba(0,0,0,.82) calc(100% - var(--fade-bottom) * .72),
    rgba(0,0,0,.18) calc(100% - var(--fade-bottom) * .28), transparent);
  -webkit-mask-image: var(--catalogue-mask);
  mask-image: var(--catalogue-mask);
}
.app-edge-before, .app-edge-after { visibility: hidden; }
.app-edge-before::after, .app-edge-after::after { background: none; }
.app-edge-before { top: 0; height: var(--fade-top, 0px); }
.app-edge-after { bottom: 0; height: var(--fade-bottom, 0px); --edge-direction: to top; }
#app.has-overflow-before > .app-edge-before,
#app.has-overflow-after > .app-edge-after { visibility: visible; }
.header-material { position: fixed; top: 0; height: calc(112px + env(safe-area-inset-top, 0px)); z-index: 0; }
.footer-material { position: fixed; bottom: 0; height: calc(62px + env(safe-area-inset-bottom, 0px)); --edge-direction: to top; z-index: 0; }
#logo, #footer > :not(.edge-material) { position: relative; z-index: 1; }
#app .app-link:focus-visible { outline: 2px solid rgba(255,255,255,.86); outline-offset: 2px; border-radius: 12px; }
#app .app-name { overflow-wrap: anywhere; }
/* The scroller remains inside the usable area in notches and short windows. */
@supports (padding: max(0px)) {
  #wrap { padding-left: max(var(--page-x-padding), env(safe-area-inset-left, 0px)); padding-right: max(var(--page-x-padding), env(safe-area-inset-right, 0px)); }
  .auth-actions { top: max(var(--auth-top), env(safe-area-inset-top, 0px)); right: max(var(--auth-right), env(safe-area-inset-right, 0px)); }
  #footer { bottom: max(var(--footer-bottom), env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  /* Three small, static filters on mobile instead of five full-strength layers. */
  .edge-material > span:nth-child(n+4) { display: none; }
  .header-material { height: 92px; }
}
@media (min-width: 992px) and (max-height: 800px) {
  /* Three complete rows on common laptop screens, including their labels. */
  body {
    --app-item-height: max(140px, calc(var(--app-icon-size) + 40px));
    --app-grid-gap: 18px;
  }
}
@media (max-height: 480px) and (min-width: 576px) {
  #wrap { padding-top: 80px; padding-bottom: 50px; }
  #top { top: 14px; }
  #logo img { max-height: 48px; max-width: 180px; }
  .logo-image-wrap { margin-bottom: 12px; }
  .wallpaper-switch-indicator { top: calc(100% + 6px); height: 2px; }
  #main { margin-top: 8px; }
  #app ul { max-height: calc(100vh - 138px); max-height: calc(100dvh - 138px); }
  .header-material { height: 68px; }
  .footer-material { height: 38px; }
  #scroll-indicator { bottom: 28px; }
}
@media (prefers-reduced-transparency: reduce), (forced-colors: active) {
  .edge-material { display: none; }
  #app { -webkit-mask-image: none; mask-image: none; }
  .app-sso-star { background: #f5e5bf; box-shadow: none; }
}
@media (forced-colors: active) {
  .app-sso-star { color: CanvasText; background: Canvas; border-color: CanvasText; }
}

.notification-tip-content.frost-underlay { --frost-pad-start: 24px; --frost-pad-end: 24px; }
.notification-tip-header.frost-floating-bar { background: transparent; border-bottom-color: transparent; }
.notification-tip-shell { position: relative; --frost-rgb: 248,250,253; }
.notification-tip-shell > .frost-edge-top { border-radius: 21px 21px 0 0; }

.notification-drawer { --frost-rgb: 249,249,251; background: rgb(var(--frost-rgb)); -webkit-backdrop-filter: none; backdrop-filter: none; }
.notification-drawer::before { content: none; }
.notification-list.frost-underlay { --frost-pad-start: 2px; --frost-pad-end: 2px; }
.notification-pagination.frost-floating-bar { background: transparent; border-top-color: transparent; }
.notification-tip-shell { --frost-rgb: 249,249,251; background: rgb(var(--frost-rgb)); }
@media (prefers-color-scheme: dark) {
  .notification-drawer, .notification-tip-shell {
    --frost-rgb: 37,37,40;
    color: #f5f5f7; border-color: #47474c; box-shadow: 0 15px 52px #0006;
  }
  .notification-drawer :is(h2,h3,strong), .notification-tip-shell :is(h2,h3,strong) { color: #f5f5f7; }
  .notification-drawer :is(.notification-header p,.notification-item p,.notification-item time,.notification-empty),
  .notification-tip-shell :is(.notification-detail-meta,.notification-rich-content) { color: #c5c5cc; }
  .notification-drawer :is(.notification-tabs,.notification-archive-filters,.notification-item,.notification-close),
  .notification-drawer :is(.notification-search-field,.notification-date-range-button,.notification-date-picker,.notification-pagination button),
  .notification-tip-shell :is(.notification-tip-close,.notification-detail-card) {
    background: #303034; border-color: #48484e; color: #f5f5f7;
  }
  .notification-drawer :is(.notification-search-field input,.notification-calendar-toolbar strong) { color: #f5f5f7; }
  .notification-drawer .notification-tabs button { color: #c5c5cc; }
  .notification-drawer :is(.notification-tabs button.is-active,.notification-marker,.notification-page-numbers button.is-active),
  .notification-tip-shell .notification-detail-severity { background: #35465d; color: #c4ddff; }
  .notification-drawer .notification-calendar button { background: #39393e; color: #e5e5ea; }
  .notification-drawer .notification-calendar button.is-in-range { background: #334357; }
  .notification-drawer .notification-calendar button:disabled { color: #86868d; background: transparent; }
  .notification-drawer .notification-calendar button.is-selected { background: #365883; color: #fff; }
  .notification-drawer .notification-calendar-footer span { color: #c5c5cc; }
  .user-menu { background: rgba(40,40,44,.88); border-color: rgba(255,255,255,.16); }
  .user-menu button, .user-menu-profile { color: #f5f5f7; }
  .user-menu-profile span { color: #c5c5cc; }
  .user-menu button:is(:hover,:focus-visible) { background: #45454b; }
}
@media (prefers-reduced-transparency: reduce) {
  .user-menu { background-color: #f9f9fb; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-reduced-transparency: reduce) and (prefers-color-scheme: dark) {
  .user-menu { background-color: #28282c; }
}

/* Keep the document title, cited passage and surrounding text visually distinct. */
.ai-reference-detail-header { display: grid; gap: 3px; margin-bottom: 12px; }
.ai-reference-detail-header small, .ai-evidence-note { color: var(--ai-muted); font-size: 13px; }
.ai-reference-detail .ai-reference-title { line-height: 1.48; font-size: 16px; font-weight: 620; overflow-wrap: anywhere; }
#ai-evidence-nav { display: inline-flex; align-items: center; gap: 2px; margin-inline-end: auto; }
#ai-evidence-nav[hidden] { display: none; }
#ai-evidence-nav button {
  display: grid; place-items: center; width: 28px; height: 30px; border: 0; border-radius: 8px;
  padding: 0; color: var(--ai-link); background: var(--ai-soft); font-size: 20px; cursor: pointer;
}
#ai-evidence-nav output { min-width: 2.5em; text-align: center; color: var(--ai-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ai-reference-header { flex-wrap: wrap; gap: 4px 8px; }
.ai-reference-header-actions { margin-inline-start: auto; }
.ai-drawer .ai-evidence-mark {
  color: inherit; background: #ffe89a; padding: .05em .13em; border-radius: .34em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.ai-reference-detail-section > summary { cursor: pointer; padding-block: 6px; }
.ai-reference-detail-section > summary:focus-visible { outline: 2px solid var(--ai-link); outline-offset: 2px; }
.ai-reference-detail .ai-structured-reference-heading { border-bottom: 1px solid var(--ai-line); padding-bottom: .28em; font-size: 1.02em; }
.ai-reference-detail .ai-reference-content { line-height: 1.7; }
.ai-reference-detail .ai-reference-content p.ai-reference-prose + p.ai-reference-prose { margin-top: .85em; }
.ai-reference-detail .ai-structured-reference-body { margin: .35em 0 !important; }
.ai-message.assistant .ai-message-content :is(h1,h2) { margin: 1em 0 .35em; font-size: 1.16em; line-height: 1.4; font-weight: 700; }
.ai-message.assistant .ai-message-content h1 { font-size: 1.26em; }
.ai-message.assistant .ai-message-content :is(h3,h4,h5,h6) { margin: .75em 0 .2em; font-size: 1.03em; line-height: 1.45; font-weight: 640; }
.ai-message.assistant .ai-message-content :is(h1,h2) + h3 { margin-top: .32em; }
.ai-message.assistant .ai-message-content :is(h1,h2,h3,h4,h5,h6) strong { font-weight: inherit; }
.ai-message.assistant .ai-message-content li > :is(ul,ol),
.ai-message.assistant .ai-message-content :is(h2,h3,h4,h5,h6) + :is(ul,ol) { margin-block: .2em .35em; }
.ai-message.assistant .ai-message-content :is(ul,ol) + p { margin-top: .75em; }
.ai-message.assistant .ai-message-content > :first-child { margin-top: 0; }
.ai-message-content .ai-inline-reference { display: inline; padding: 1px 5px; margin-inline: 2px; border-radius: 5px; font-size: .76em; font-weight: 550; white-space: nowrap; vertical-align: .07em; }
.ai-drawer .ai-message.user { border-radius: 16px 16px 5px 16px; }
.ai-drawer .ai-message-form { border-radius: 18px; }
@media (prefers-color-scheme: dark) {
  .ai-drawer .ai-evidence-mark { color: #fff4cf; background: #6d5625; }
}
@media (forced-colors: active) { .ai-evidence-mark { text-decoration: underline; } }
.ai-reference-detail .ai-source-subheading {
  margin: .8em 0 .2em !important; padding-inline-start: 0; font-weight: 630; color: var(--ai-ink);
}
.ai-reference-detail p.ai-source-heading {
  margin: 1em 0 .3em !important; padding-top: .6em; border-top: 1px solid var(--ai-line);
  color: var(--ai-ink); font-size: 1.08em; font-weight: 680;
}
@media (max-width: 580px) {
  .ai-reference-panel .ai-reference-header { flex-wrap: nowrap; gap: 5px; padding-inline: 12px; }
  .ai-reference-header-actions { width: auto; flex: none; gap: 4px; }
  #ai-evidence-nav { gap: 0; }
  #ai-evidence-nav output { min-width: 2.2em; }
  #ai-evidence-nav button { width: 26px; min-height: 36px; }
  .ai-reference-header .ai-reference-download { padding-inline: 8px; }
}

@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  #top { pointer-events: none; }
  #logo.is-wallpaper-toggle .logo-image-wrap { pointer-events: auto; }
  #footer .info-btn::before {
    content: "";
    position: absolute;
    inset: -14px -8px;
  }
}

.notification-archive-filters.frost-floating-bar { z-index: 5; }
.notification-date-picker { overflow-y: auto; overscroll-behavior: contain; }
.notification-date-picker.opens-above { top: auto; bottom: calc(100% + 8px); }

@media (max-width: 799px), (max-height: 550px) {
  .xiya-modern-mode .user-menu {
    max-height: calc(100dvh - max(var(--auth-top), env(safe-area-inset-top)) - max(10px, env(safe-area-inset-bottom)));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .xiya-modern-mode .modal-overlay {
    top: var(--home-visible-top, 0px);
    height: var(--home-visible-height, 100dvh);
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .xiya-modern-mode .modal-content {
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .xiya-modern-mode .login-card-content { min-height: min(430px, 100%); }
}

/* In a short drawer the archive filters and pager can occupy the entire
   viewport. Let the drawer scroll enough to expose a complete result. */
@media (max-height: 500px) {
  .notification-drawer { overflow-y: auto; }
  .notification-drawer > [data-frost-bar] { flex-shrink: 0; }
  .notification-archive-filters:not([hidden]) + .notification-list {
    min-height: calc(var(--frost-before, 0px) + var(--frost-after, 0px) + 8rem);
  }
}

/* Give the halo room outside the balanced grid without moving its cards. */
#main { --app-glow-gutter: 44px; }
#main.has-catalogue-glow #From_WorkApp {
  flex: none;
  width: calc(100% + 2 * var(--app-glow-gutter));
  max-width: 100vw;
  margin-block: calc(0px - var(--app-glow-gutter));
}
#main.has-catalogue-glow #app ul.is-balanced-layout {
  width: calc(var(--app-layout-width) + 2 * var(--app-glow-gutter));
  padding-block: calc(var(--app-grid-edge-padding) + var(--app-glow-gutter));
  /* Keep the original column width even where the screen limits the gutter. */
  padding-inline: clamp(0px, calc((100% - var(--app-layout-width)) / 2), var(--app-glow-gutter));
}

/* Mask scrolling rows at the original viewport edges. Leave the gutter
   exposed at either end once there are no more rows on that side. */
#main.has-catalogue-glow #app:is(.has-overflow-before, .has-overflow-after) {
  --glow-inset-top: min(var(--app-glow-gutter), calc(2 * var(--app-edge-before, 0px)));
  --glow-inset-bottom: min(var(--app-glow-gutter), calc(2 * var(--app-edge-after, 0px)));
  -webkit-mask-position: 0 var(--glow-inset-top);
  mask-position: 0 var(--glow-inset-top);
  -webkit-mask-size: 100% calc(100% - var(--glow-inset-top) - var(--glow-inset-bottom));
  mask-size: 100% calc(100% - var(--glow-inset-top) - var(--glow-inset-bottom));
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  clip-path: inset(var(--glow-inset-top) 0 var(--glow-inset-bottom));
}
#main.has-catalogue-glow .app-edge-before { top: var(--glow-inset-top, 0px); }
#main.has-catalogue-glow .app-edge-after { bottom: var(--glow-inset-bottom, 0px); }

/* Catalogue glow around the icon, outside its squircle mask. */
#app .app-legacy-glow-visual {
  position: relative;
  display: block;
  width: 82px;
  height: 82px;
  margin: 0 auto 9px;
  isolation: isolate;
}
#app ul li[data-glow-expires] .app-icon-visual {
  isolation: isolate;
}

#app ul li[data-glow-expires] .app-icon {
  position: relative;
  z-index: 0;
}

#app .app-glow-layer {
  position: absolute;
  top: -8px; right: -8px; bottom: -8px; left: -8px;
  pointer-events: none;
  overflow: visible;
}

#app .app-glow-aura {
  position: absolute;
  inset: 7px;
  z-index: -1;
  border-radius: 30%;
  background:
    radial-gradient(circle at 26% 22%, rgba(255, 248, 224, 0.72), transparent 56%),
    radial-gradient(circle at 78% 76%, rgba(168, 214, 255, 0.56), transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(255, 224, 152, 0.42), rgba(148, 200, 255, 0.16) 62%, transparent 78%);
  box-shadow:
    0 0 18px rgba(255, 226, 154, 0.48),
    0 0 32px rgba(154, 208, 255, 0.28);
  filter: blur(5px);
  opacity: 0.72;
  animation: app-glow-aura-breathe 4.4s ease-in-out infinite;
}

#app .app-glow-star {
  position: absolute;
  z-index: 3;
  display: block;
  color: #fff8de;
  transform: translate(-50%, -50%) scale(0.45);
  opacity: .8;
  filter: drop-shadow(0 0 4px rgba(255, 240, 186, 0.95)) drop-shadow(0 0 9px rgba(173, 219, 255, 0.65));
  animation: app-glow-star-twinkle 3.2s ease-in-out infinite;
}

#app .app-glow-star svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

#app .app-glow-dust {
  position: absolute;
  z-index: 3;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #ffeab8 58%, rgba(255, 232, 174, 0) 100%);
  box-shadow: 0 0 6px rgba(255, 238, 184, 0.88);
  opacity: .6;
  transform: translate(-50%, -50%) scale(0.5);
  animation: app-glow-dust-float 3.6s ease-in-out infinite;
}

@keyframes app-glow-aura-breathe {
  0%, 100% {
    opacity: 0.56;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.94;
    transform: scale(1.06);
  }
}

@keyframes app-glow-star-twinkle {
  0%, 18%, 100% {
    opacity: 0.08;
    transform: translate(-50%, -50%) scale(0.36) rotate(0deg);
  }
  44% {
    opacity: 1;
    transform: translate(-50%, calc(-50% + -2px)) scale(1.12) rotate(18deg);
  }
  68% {
    opacity: 0.35;
    transform: translate(-50%, calc(-50% + -1px)) scale(0.68) rotate(32deg);
  }
}

@keyframes app-glow-dust-float {
  0%, 100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45);
  }
  30% {
    opacity: 0.92;
    transform: translate(calc(-50% + 1px), calc(-50% + -2px)) scale(1.05);
  }
  72% {
    opacity: 0.42;
    transform: translate(calc(-50% + 2px), calc(-50% + -4px)) scale(0.75);
  }
}

/* On touchscreens keep the filtered artwork still. Two stars twinkle using
   opacity alone while the catalogue's scroll mask and soft edges are active. */
@media (hover: none) and (pointer: coarse) and (prefers-reduced-motion: no-preference) {
  #app .app-glow-aura,
  #app .app-glow-dust,
  #app .app-glow-star {
    animation-name: none;
  }

  #app .app-glow-star { transform: translate(-50%, -50%) scale(.82); }
  #app .app-glow-dust { transform: translate(-50%, -50%) scale(.75); }
  #app .app-glow-star:nth-of-type(2),
  #app .app-glow-star:nth-of-type(5) {
    animation-name: app-glow-star-pulse;
  }

  /* The PIN dialog blurs the catalogue behind it. Keep that backdrop still. */
  body:has(#pin-modal.show) #app .app-glow-star { animation-play-state: paused; }
}

@keyframes app-glow-star-pulse {
  0%, 100% { opacity: .25; }
  50% { opacity: 1; }
}

@media (max-width: 575px) {
  #app .app-glow-layer {
    top: -6px; right: -6px; bottom: -6px; left: -6px;
  }

  #app .app-glow-aura {
    inset: 5px;
    filter: blur(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #app .app-glow-aura,
  #app .app-glow-star,
  #app .app-glow-dust {
    animation: none;
  }

  #app .app-glow-aura {
    opacity: 0.72;
    transform: none;
  }

  #app .app-glow-star {
    opacity: 0;
  }

  #app .app-glow-star:nth-of-type(2),
  #app .app-glow-star:nth-of-type(5) {
    opacity: 0.88;
    transform: translate(-50%, -50%) scale(0.92);
  }

  #app .app-glow-dust {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(0.85);
  }
}

@media (forced-colors: active) {
  #app .app-glow-aura, #app .app-glow-dust { display: none; }
  #app .app-glow-star { color: CanvasText; opacity: 1; animation: none; filter: none; }
}
