:root {
  color-scheme: light;
  --sidebar-width: 92px;
  --icon-size: 68px;
  --search-opacity: 0.9;
  --search-box-width: 70%;
  --search-height: 66px;
  --search-radius: 4px;
  --icon-grid-width: 100%;
  --icon-opacity: 0.8;
  --icon-radius: 15%;
  --icon-column-gap: 40px;
  --icon-row-gap: 28px;
  --search-icon-gap: 50px;
  --wallpaper-blur: 0px;
  --page-brightness: 0.7;
  --text: #fff;
  --soft-text: rgba(255, 255, 255, 0.93);
  --sidebar: rgba(42, 61, 72, 0.52);
  --sidebar-active: rgba(255, 255, 255, 0.11);
  --glass: rgba(231, 242, 248, 0.77);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --ink: #6c747a;
  --blue: #3158dc;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  color: var(--text);
  background: #2085b8 url("assets/background.webp") center / cover no-repeat fixed;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background: rgba(8, 24, 42, calc((1 - var(--page-brightness)) * 0.72));
  backdrop-filter: blur(var(--wallpaper-blur));
  transition: background 180ms ease;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app-shell {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 620px;
  transform: scale(var(--desktop-scale, 1));
  transform-origin: top left;
}

.mobile-menu-toggle,
.mobile-sidebar-backdrop,
.mobile-sidebar-rail {
  display: none;
}

.sidebar {
  position: relative;
  z-index: 5;
  display: flex;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100%;
  flex-direction: column;
  align-items: stretch;
  background: var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(8px);
}

.avatar-button {
  width: 54px;
  height: 54px;
  min-height: 54px;
  padding: 0;
  margin: 63px auto 90px;
  cursor: pointer;
  background: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 5px 18px rgba(12, 43, 66, 0.08);
  overflow: hidden;
}

.avatar-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-nav {
  display: flex;
  flex-direction: column;
}

.category-button {
  display: flex;
  width: 100%;
  height: 94px;
  padding: 10px 4px 8px;
  cursor: grab;
  background: transparent;
  border: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 19px;
  transition:
    background 150ms ease,
    color 150ms ease;
}

.category-button:active {
  cursor: grabbing;
}

.category-button.is-category-drag-placeholder {
  visibility: hidden;
}

.category-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1001;
  display: flex;
  pointer-events: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(8px * var(--category-drag-scale, 1));
  color: #fff;
  font-size: calc(19px * var(--category-drag-scale, 1));
  filter: none;
  transform: translate3d(-1000px, -1000px, 0);
  will-change: transform;
}

.category-button svg {
  width: 39px;
  height: 39px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.category-icon-image {
  width: 35px;
  height: 35px;
  object-fit: contain;
  pointer-events: none;
}

.category-drag-ghost svg {
  display: block;
  width: calc(39px * var(--category-drag-scale, 1));
  height: calc(39px * var(--category-drag-scale, 1));
  fill: none;
  stroke: currentColor;
  stroke-width: calc(1.8 * var(--category-drag-scale, 1));
  stroke-linecap: round;
  stroke-linejoin: round;
}

.category-drag-ghost .category-icon-image {
  display: block;
  width: calc(35px * var(--category-drag-scale, 1));
  height: calc(35px * var(--category-drag-scale, 1));
  object-fit: contain;
}

.category-button.is-active {
  color: #fff;
  background: var(--sidebar-active);
}

.sidebar-actions {
  display: flex;
  padding-bottom: 33px;
  margin-top: auto;
  flex-direction: column;
  align-items: center;
  gap: 31px;
}

.side-action,
.theme-toggle,
.minimal-actions button {
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.side-action svg {
  width: 39px;
  height: 39px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-action:hover svg {
  stroke: #fff;
}

.content {
  position: relative;
  display: flex;
  height: 100%;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
}

.theme-toggle {
  position: absolute;
  top: 34px;
  right: 30px;
  z-index: 3;
}

.theme-toggle svg {
  width: 43px;
  height: 43px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.minimal-actions {
  position: absolute;
  top: 32px;
  right: 35px;
  z-index: 4;
  display: none;
  align-items: center;
  gap: 40px;
}

.minimal-actions button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
}

.minimal-actions svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.clock-panel {
  margin-top: 94px;
  text-align: center;
  text-shadow: 0 3px 13px rgba(13, 66, 104, 0.1);
}

.clock-panel,
.search-bar,
.link-grid {
  transform: translateX(calc(var(--sidebar-width) / -2));
}

.clock {
  display: block;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 112px;
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -4px;
}

.calendar {
  margin-top: 9px;
  font-size: 27px;
  font-weight: 400;
  letter-spacing: 0.1px;
}

.search-bar {
  position: relative;
  z-index: 12;
  display: flex;
  width: var(--search-box-width);
  max-width: calc(100% - 120px);
  height: var(--search-height);
  min-height: 62px;
  margin-top: 53px;
  color: var(--ink);
  background: rgba(231, 242, 248, var(--search-opacity));
  border-radius: var(--search-radius);
  align-items: center;
  box-shadow: 0 10px 26px rgba(19, 91, 133, 0.04);
  backdrop-filter: blur(14px);
}

.engine-button {
  display: flex;
  width: 112px;
  height: 100%;
  padding: 0 12px 0 27px;
  cursor: pointer;
  background: transparent;
  border: 0;
  align-items: center;
  gap: 15px;
}

.engine-button[aria-expanded="true"] .engine-chevron {
  transform: rotate(180deg);
}

.engine-button img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.engine-chevron {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: #91999f;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.search-bar input {
  min-width: 0;
  height: 100%;
  padding: 0 20px 1px 5px;
  color: #555e64;
  outline: none;
  background: transparent;
  border: 0;
  flex: 1;
  font-size: 27px;
}

.search-bar input::placeholder {
  color: #727a80;
  opacity: 0.5;
}

.search-bar input::-webkit-search-cancel-button {
  display: none;
}

.search-submit {
  display: grid;
  width: 79px;
  height: 100%;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  place-items: center;
}

.search-submit svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: #686f74;
  stroke-width: 1.65;
  stroke-linecap: round;
}

.engine-menu {
  position: absolute;
  top: calc(100% + 13px);
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  width: 100%;
  min-height: 142px;
  padding: 21px 46px 19px;
  color: #11171b;
  visibility: hidden;
  background: rgba(232, 245, 251, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 42px;
  box-shadow: 0 15px 31px rgba(20, 89, 126, 0.16);
  opacity: 0;
  transform: translateY(-8px);
  backdrop-filter: blur(18px);
  grid-template-columns: repeat(8, minmax(74px, 1fr));
  gap: 16px;
  pointer-events: none;
  transition:
    opacity 170ms ease,
    transform 170ms ease,
    visibility 170ms ease;
}

.engine-menu.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.engine-option {
  display: flex;
  min-width: 0;
  padding: 10px 0 8px;
  cursor: pointer;
  color: #0d1216;
  background: transparent;
  border: 0;
  border-radius: 18px;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  font-size: 21px;
  line-height: 1.1;
  transition:
    color 150ms ease,
    transform 150ms ease;
}

.engine-option:hover,
.engine-option.is-active {
  color: #234ecf;
  transform: translateY(-1px);
}

.engine-option img {
  width: 66px;
  height: 66px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(20, 78, 112, 0.06);
  object-fit: contain;
  transition:
    box-shadow 150ms ease,
    transform 150ms ease;
}

.engine-option img[src$="douyin-logo.svg"] {
  padding: 12px;
}

.engine-option img[src$="zhihu.svg"] {
  padding: 6px;
}

.engine-option:hover img,
.engine-option.is-active img {
  box-shadow: 0 10px 22px rgba(49, 88, 220, 0.16);
  transform: scale(1.03);
}

.link-grid {
  position: relative;
  z-index: 1;
  display: grid;
  width: var(--icon-grid-width);
  max-width: calc(100% - 120px);
  margin-top: var(--search-icon-gap);
  grid-template-columns: repeat(auto-fit, minmax(calc(var(--icon-size) + 32px), 1fr));
  justify-content: center;
  column-gap: var(--icon-column-gap);
  row-gap: var(--icon-row-gap);
}

.link-card {
  display: flex;
  min-width: calc(var(--icon-size) + 32px);
  cursor: pointer;
  color: var(--soft-text);
  outline: none;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  user-select: none;
  will-change: transform;
}

.link-card.is-draggable {
  cursor: grab;
}

.link-card.is-draggable:active {
  cursor: grabbing;
}

.link-card.is-drag-placeholder .link-icon,
.link-card.is-drag-placeholder .link-name {
  opacity: 0;
  visibility: hidden;
}

.link-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: grid;
  opacity: 1;
  pointer-events: none;
  filter: drop-shadow(0 16px 28px rgba(14, 35, 52, 0.28));
  place-items: center;
  transform: translate3d(-1000px, -1000px, 0);
  will-change: transform;
}

.link-drag-ghost .link-icon {
  width: 100%;
  height: 100%;
  filter: none;
  transform: none;
  transition: none;
}

.link-icon {
  display: grid;
  width: calc(var(--icon-size) + 32px);
  height: calc(var(--icon-size) + 32px);
  overflow: hidden;
  background: transparent;
  border-radius: var(--icon-radius);
  place-items: center;
  transition:
    transform 170ms ease,
    filter 170ms ease;
}

.link-icon img {
  width: 100%;
  height: 100%;
  opacity: var(--icon-opacity);
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

body.settings-hide-icons .link-icon {
  display: none;
}

body.settings-hide-names .link-name {
  display: none;
}

.link-icon img[src$="Solutions.svg"] {
  width: 145%;
  height: 145%;
}

.link-card:hover .link-icon,
.link-card:focus-visible .link-icon {
  z-index: 2;
  filter: brightness(1.04);
  transform: translateY(-5px) scale(1.04);
}

.link-name {
  max-width: 132px;
  margin-top: 13px;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 2px 5px rgba(12, 54, 82, 0.45);
  white-space: nowrap;
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(0, 0, 0, 0.25);
}

.settings-backdrop[hidden] {
  display: none;
}

.settings-panel {
  position: fixed;
  bottom: 15px;
  left: 60px;
  z-index: 30;
  display: grid;
  width: min(705px, calc(100vw - 48px));
  height: min(964px, calc(100vh - 48px));
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  color: #2d343a;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  grid-template-columns: 211px minmax(0, 1fr);
  transform: translate(0, 10px) scale(0.792925);
  transform-origin: bottom left;
  transition:
    opacity 180ms ease,
    transform 220ms ease;
}

.settings-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, 0) scale(0.805);
}

.settings-tabs {
  display: grid;
  padding: 64px 20px 24px;
  align-content: start;
  background: rgba(246, 247, 249, 0.6);
  border-right: 1px solid #e4e8ed;
  gap: 14px;
}

.settings-tab-list {
  display: grid;
  gap: 14px;
}

.settings-tabs button {
  min-height: 44px;
  padding: 0 22px;
  cursor: pointer;
  color: #343b42;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.settings-tabs button.is-active {
  color: #1e78ff;
  background: #fff;
  box-shadow: 0 14px 34px rgba(33, 47, 61, 0.08);
}

.settings-profile-tab {
  display: grid;
  min-height: 76px;
  padding: 16px 18px;
  grid-template-columns: 48px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
}

.settings-profile-avatar {
  display: grid;
  width: 38.4px;
  height: 38.4px;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(19, 39, 59, 0.12);
  place-items: center;
}

.settings-profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-profile-meta {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.settings-profile-meta strong {
  color: #25303a;
  font-size: 18px;
  font-weight: 700;
}

.settings-profile-meta small {
  color: #8a96a2;
  font-size: 12px;
}

.settings-profile-arrow {
  width: 18px;
  height: 18px;
  color: #9aa5b1;
  transform: rotate(-90deg);
}

.settings-main {
  display: grid;
  min-height: 0;
  min-width: 0;
  background: rgba(255, 255, 255, 0.6);
  grid-template-rows: 22px minmax(0, 1fr) auto;
}

.settings-head {
  display: flex;
  padding: 6px 18px 0;
  justify-content: flex-end;
  align-items: flex-start;
  cursor: default;
}

.settings-head button {
  height: 24px;
  padding: 0;
  cursor: pointer;
  color: #54626a;
  background: transparent;
  border: 0;
  font-size: 18px;
  line-height: 1;
}

#closeSettings {
  display: grid;
  width: 25px;
  color: #515960;
  font-size: 20px;
  place-items: center;
}

.settings-content {
  min-height: 0;
  padding: 14px 42px 24px;
  overflow-y: auto;
  scrollbar-color: rgba(47, 124, 255, 0.55) rgba(226, 231, 237, 0.8);
  scrollbar-width: thin;
}

.settings-content::-webkit-scrollbar {
  width: 8px;
}

.settings-content::-webkit-scrollbar-track {
  background: rgba(226, 231, 237, 0.8);
  border-radius: 999px;
}

.settings-content::-webkit-scrollbar-thumb {
  background: rgba(47, 124, 255, 0.55);
  border-radius: 999px;
}

.settings-actions {
  display: flex;
  padding: 11px 42px 15px;
  justify-content: flex-end;
  gap: 12px;
  background: #fff;
  border-top: 1px solid #e6eaee;
}

.settings-actions button {
  min-width: 74px;
  height: 30px;
  cursor: pointer;
  color: #4e5963;
  background: #f0f3f6;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
}

.settings-actions .settings-confirm {
  color: #fff;
  background: #4285f4;
}

.settings-panel[data-active-tab="account"] .settings-actions {
  display: none;
}

.settings-panel[data-active-tab="account"] .settings-content {
  display: grid;
  padding-top: 0;
  place-items: center;
}

.settings-section {
  display: none;
  max-width: 456px;
  padding: 0;
  margin: 0;
  background: transparent;
  border-radius: 0;
}

.settings-section.is-active {
  display: block;
}

.settings-account-section {
  width: 100%;
  max-width: 540px;
}

.settings-account-section.is-active {
  display: grid;
  min-height: 100%;
  align-items: center;
}

.settings-account-hero {
  display: grid;
  width: min(100%, 460px);
  padding: 18px 16px 34px;
  justify-items: center;
  gap: 20px;
}

.settings-account-logo {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 18px;
  overflow: hidden;
  filter: drop-shadow(0 10px 22px rgba(36, 74, 132, 0.18));
}

.settings-account-title {
  margin: 0;
  color: #a0adbb;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.7;
  text-align: center;
}

.settings-login-button {
  min-width: 166.4px;
  height: 41.6px;
  padding: 0 22.4px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #4a97f5, #2e7ef4);
  border: 0;
  border-radius: 9.6px;
  box-shadow: 0 18px 32px rgba(43, 122, 240, 0.24);
  font-size: 19.2px;
  font-weight: 600;
}

.settings-login-button.is-secondary {
  color: #2f5ec7;
  background: rgba(66, 133, 244, 0.12);
  box-shadow: none;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.account-summary {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-summary-item {
  display: grid;
  padding: 14px 16px;
  background: rgba(244, 247, 251, 0.96);
  border-radius: 16px;
  gap: 6px;
  text-align: left;
}

.account-summary-item span {
  color: #7f8b97;
  font-size: 13px;
}

.account-summary-item strong {
  color: #25303a;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.account-sync-status {
  margin: 0;
  color: #6d7b88;
  font-size: 14px;
}

.settings-section h3 {
  padding-bottom: 13px;
  margin: 0 0 20px;
  color: #151b20;
  border-bottom: 1px solid #dfe4ea;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(6, 17, 29, 0.42);
  backdrop-filter: blur(8px);
}

.auth-backdrop[hidden] {
  display: none;
}

.auth-modal {
  position: relative;
  width: min(540px, calc(100vw - 32px));
  max-height: min(88vh, 760px);
  padding: 30px 28px 24px;
  overflow-y: auto;
  color: #25303a;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  box-shadow: 0 30px 70px rgba(10, 32, 55, 0.24);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  color: #5e6b77;
  background: transparent;
  border: 0;
  font-size: 24px;
}

.auth-modal h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.auth-mode-switch {
  display: inline-grid;
  padding: 4px;
  margin-bottom: 14px;
  background: #edf3f8;
  border-radius: 999px;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.auth-mode-switch button {
  min-width: 92px;
  height: 38px;
  cursor: pointer;
  color: #60707c;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
}

.auth-mode-switch button.is-active {
  color: #1f5ed7;
  background: #fff;
  box-shadow: 0 10px 24px rgba(30, 67, 127, 0.1);
}

.profile-modal {
  max-width: 520px;
}

.auth-subtitle {
  margin: 0 0 22px;
  color: #72808d;
  line-height: 1.7;
}

.auth-form,
.auth-profile-grid {
  display: grid;
  gap: 14px;
}

.auth-form {
  padding-bottom: 4px;
}

.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-form span {
  color: #52606d;
  font-size: 14px;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: #24323f;
  background: #f5f8fb;
  border: 1px solid #d8e2eb;
  border-radius: 14px;
  outline: none;
}

.auth-form input:focus {
  border-color: #4a97f5;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 152px;
  gap: 12px;
  align-items: end;
}

.auth-code-row label {
  min-width: 0;
}

.auth-secondary-button {
  height: 48px;
  cursor: pointer;
  color: #3158dc;
  background: rgba(49, 88, 220, 0.09);
  border: 0;
  border-radius: 14px;
  font-weight: 600;
}

.auth-status {
  min-height: 22px;
  margin: 0;
  color: #5f6f7b;
  font-size: 14px;
}

.auth-status.is-error {
  color: #d14b4b;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.wallpaper-preview-card {
  display: grid;
  margin: 0 0 28px;
  gap: 18px;
}

.wallpaper-preview-image {
  width: 100%;
  aspect-ratio: 16 / 7.2;
  background: #d9e4ef center / cover no-repeat;
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px rgba(225, 231, 238, 0.92);
}

.wallpaper-preview-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.wallpaper-action-button {
  min-width: 132px;
  height: 46px;
  padding: 0 24px;
  cursor: pointer;
  color: #56616c;
  background: #eef2f7;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(26, 40, 56, 0.06);
  font-size: 17px;
  font-weight: 600;
}

.wallpaper-action-button.is-primary {
  color: #fff;
  background: linear-gradient(135deg, #4a97f5, #2e7ef4);
}

.preset-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.preset-row button {
  min-height: 52px;
  padding: 0 20px;
  cursor: pointer;
  color: #2f363b;
  background: #fff;
  border: 1px solid #dde3e7;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 600;
}

.setting-range {
  display: grid;
  grid-template-columns: 132px minmax(132px, 1fr) 55px;
  margin: 0 0 23px;
  align-items: center;
  gap: 13px;
  font-size: 13px;
}

.setting-range output {
  text-align: right;
  color: #1e78ff;
}

.setting-range input {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  accent-color: #2d7cff;
}

.setting-switch {
  display: grid;
  grid-template-columns: 1fr auto;
  min-height: 29px;
  margin-top: 14px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.setting-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.setting-switch i {
  position: relative;
  width: 23px;
  height: 13px;
  background: #e8e8e8;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
}

.setting-switch i::after {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 9px;
  height: 9px;
  background: #fff;
  border-radius: 50%;
  content: "";
  transition: transform 160ms ease;
}

.setting-switch input:checked + i {
  background: #347df0;
  border-color: #347df0;
}

.setting-switch input:checked + i::after {
  transform: translateX(10px);
}

@media (max-width: 900px) {
  .settings-panel {
    top: 50%;
    left: 50%;
    bottom: auto;
    width: min(560px, calc(100vw - 24px));
    height: min(874px, calc(100vh - 24px));
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    grid-template-columns: 1fr;
    background: #ffffff;
    transform-origin: center;
    transform: translate(-50%, calc(-50% + 10px)) scale(0.792925);
  }

  .settings-panel.is-open {
    transform: translate(-50%, -50%) scale(0.805);
  }

  .settings-tabs {
    display: none;
  }

  .settings-tab-list {
    display: none;
  }

  .settings-main {
    min-height: 0;
    grid-template-rows: 22px minmax(0, 1fr) auto;
  }

  .settings-head {
    min-height: 22px;
    padding: 6px 18px 0;
    cursor: default;
  }

  .settings-content {
    display: block;
    padding: 20px 20px 20px;
  }

  .settings-panel[data-active-tab="account"] .settings-content {
    display: block;
    padding: 20px 20px 20px;
    place-items: initial;
  }

  .settings-panel[data-active-tab="account"] .settings-actions {
    display: flex;
  }

  .settings-section,
  .settings-section.is-active {
    display: block;
    max-width: none;
  }

  .settings-section + .settings-section {
    margin-top: 30px;
  }

  .settings-account-section.is-active {
    display: block;
    min-height: 0;
  }

  .settings-account-hero {
    width: 100%;
    padding: 4px 0 18px;
    gap: 18px;
  }

  .settings-account-logo {
    width: 78px;
    height: 78px;
  }

  .settings-account-title {
    font-size: 22px;
  }

  .wallpaper-preview-image {
    border-radius: 20px;
  }

  .wallpaper-preview-actions {
    flex-wrap: wrap;
    gap: 12px;
  }

  .wallpaper-action-button {
    min-width: 0;
    flex: 1 1 0;
    height: 48px;
    padding: 0 18px;
    font-size: 18px;
  }

  .settings-login-button {
    width: 100%;
    max-width: 224px;
    min-width: 0;
    height: 44.8px;
    font-size: 17.6px;
  }

  .settings-section h3 {
    margin-bottom: 26px;
    font-size: 24px;
  }

  .setting-range {
    grid-template-columns: 1fr auto;
    gap: 12px;
    font-size: 17px;
  }

  .setting-range input {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .setting-switch {
    font-size: 17px;
  }
}

.reset-button,
.primary-button {
  cursor: pointer;
  color: #fff;
  background: #3978dd;
  border: 0;
  border-radius: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  padding: 20px;
  background: rgba(10, 25, 38, 0.38);
  place-items: center;
  backdrop-filter: blur(7px);
}

.modal-backdrop[hidden] {
  display: none;
}

.context-menu {
  position: fixed;
  z-index: 50;
  display: grid;
  min-width: 120px;
  padding: 5px 10px;
  color: #101820;
  background:
    radial-gradient(circle at 58% 60%, rgba(226, 143, 205, 0.42), rgba(226, 143, 205, 0) 33%),
    linear-gradient(180deg, rgba(190, 218, 241, 0.86), rgba(197, 222, 231, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 13px;
  box-shadow:
    0 16px 34px rgba(17, 48, 74, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(22px) saturate(116%);
  gap: 1px;
}

.context-menu[hidden] {
  display: none;
}

.context-menu button {
  display: flex;
  min-height: 32px;
  padding: 0 11px;
  cursor: pointer;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 9px;
  align-items: center;
  gap: 6px;
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0;
  transition:
    background 140ms ease,
    transform 140ms ease;
}

.context-menu button svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.context-menu button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(1px);
}

.context-menu-move,
.context-menu-copy {
  position: relative;
}

.context-menu-move::after,
.context-menu-copy::after {
  position: absolute;
  top: 0;
  right: -4px;
  bottom: 0;
  width: 6px;
  content: "";
}

.context-menu.is-submenu-left .context-menu-move::after,
.context-menu.is-submenu-left .context-menu-copy::after {
  right: auto;
  left: -4px;
}

.context-menu-chevron {
  margin-left: auto;
  transform: rotate(-90deg);
  transform-origin: center;
}

.move-category-menu {
  position: absolute;
  top: var(--move-menu-top, 65px);
  left: var(--move-menu-left, calc(100% + 2px));
  display: grid;
  min-width: 118px;
  padding: 5px;
  visibility: hidden;
  background:
    radial-gradient(circle at 52% 72%, rgba(226, 143, 205, 0.32), rgba(226, 143, 205, 0) 36%),
    linear-gradient(180deg, rgba(190, 218, 241, 0.9), rgba(197, 222, 231, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(17, 48, 74, 0.14);
  opacity: 0;
  transform: translateX(-4px);
  backdrop-filter: blur(22px) saturate(116%);
  gap: 1px;
  pointer-events: none;
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 140ms ease;
}

.move-category-menu::before {
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: -2px;
  width: 4px;
  content: "";
}

.context-menu.is-submenu-left .move-category-menu {
  right: calc(100% + 2px);
  left: auto;
}

.context-menu.is-submenu-left .move-category-menu::before {
  right: -2px;
  left: auto;
}

.context-menu-move:hover + #moveCategoryMenu,
.context-menu.is-move-open #moveCategoryMenu,
#moveCategoryMenu:hover,
.context-menu-copy:hover + #copyCategoryMenu,
.context-menu.is-copy-open #copyCategoryMenu,
#copyCategoryMenu:hover {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.move-category-menu button {
  min-height: 26px;
  justify-content: flex-start;
}

.context-menu button[data-menu-action="delete"] {
  margin-top: 2px;
  color: #262c32;
}

@media (max-width: 900px) {
  .context-menu {
    min-width: 182px;
    padding: 5px 9px;
    border-radius: 12px;
  }

  .context-menu button {
    min-height: 29px;
    padding: 0 10px;
    gap: 5px;
    font-size: 13px;
  }

  .context-menu button svg {
    width: 17px;
    height: 17px;
  }

  .move-category-menu {
    top: var(--move-menu-top, 59px);
    min-width: 106px;
  }
}

.add-modal {
  width: min(430px, 100%);
  padding: 30px;
  color: #34434c;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(12, 38, 57, 0.3);
}

.add-modal h2 {
  margin: 0 0 26px;
}

.add-modal label {
  display: grid;
  margin: 16px 0;
  gap: 8px;
}

.add-modal input {
  width: 100%;
  padding: 12px 14px;
  color: #334047;
  outline: none;
  background: #f5f7fa;
  border: 1px solid #dce3e8;
  border-radius: 10px;
}

.add-modal input:focus {
  border-color: #4c86e5;
}

.icon-picker {
  padding: 0;
  margin: 16px 0 0;
  border: 0;
}

.icon-picker legend {
  margin-bottom: 8px;
}

.icon-picker-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 16px;
}

.icon-preview {
  display: grid;
  width: 58px;
  height: 58px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d1d6db;
  border-radius: 14px;
  place-items: center;
}

.icon-preview img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.icon-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.icon-mode-tabs label {
  display: block;
  margin: 0;
}

.icon-mode-tabs input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.icon-mode-tabs span {
  display: grid;
  min-height: 42px;
  cursor: pointer;
  color: #52636d;
  background: #edf1f4;
  border-radius: 999px;
  place-items: center;
}

.icon-mode-tabs input:checked + span {
  color: #fff;
  background: #4285f4;
  box-shadow: 0 8px 18px rgba(54, 122, 221, 0.24);
}

.icon-upload-name {
  display: block;
  overflow: hidden;
  margin: 8px 0 0 80px;
  color: #6b7981;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.modal-actions {
  display: flex;
  margin-top: 25px;
  justify-content: flex-end;
  gap: 10px;
}

.modal-actions button {
  padding: 10px 22px;
  cursor: pointer;
  color: #4f5c63;
  background: #edf1f4;
  border: 0;
  border-radius: 9px;
}

.modal-actions .primary-button {
  color: #fff;
  background: #3978dd;
}

.toast {
  position: fixed;
  bottom: 34px;
  left: 50%;
  z-index: 60;
  padding: 11px 19px;
  color: #3d4a51;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 20px;
  box-shadow: 0 10px 32px rgba(13, 45, 67, 0.18);
  opacity: 0;
  transform: translate(-50%, 20px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.is-dim {
  --page-brightness: 0.64;
}

body.is-minimal .sidebar,
body.is-minimal .theme-toggle,
body.is-minimal .link-grid {
  display: none;
}

body.is-minimal .minimal-actions {
  display: flex;
}

body.is-minimal .clock-panel,
body.is-minimal .search-bar {
  transform: none;
}

body.is-minimal .clock-panel {
  margin-top: 274px;
}

body.is-minimal .search-bar {
  margin-top: 37px;
}

@media (max-width: 900px) {
  :root {
    --mobile-sidebar-width: 52px;
    --mobile-sidebar-logo-size: 28px;
    --mobile-sidebar-icon-size: 20px;
    --mobile-sidebar-text-size: 11px;
    --mobile-sidebar-item-height: 44px;
    --mobile-sidebar-action-height: 30px;
  }

  html,
  body {
    height: var(--mobile-viewport-height, 100vh);
    max-height: var(--mobile-viewport-height, 100vh);
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.is-mobile-sidebar-open {
    overflow: hidden;
    background-image:
      linear-gradient(
        90deg,
        rgba(49, 65, 55, 0.74) 0 var(--mobile-sidebar-width),
        transparent var(--mobile-sidebar-width)
      ),
      url("assets/background.webp");
    background-position:
      left top,
      center;
    background-size:
      100% 100%,
      cover;
    background-repeat:
      no-repeat,
      no-repeat;
    background-attachment:
      scroll,
      fixed;
  }

  .mobile-menu-toggle {
    position: fixed;
    top: 27px;
    left: 29px;
    z-index: 35;
    display: grid;
    width: 29px;
    height: 29px;
    padding: 4px;
    cursor: pointer;
    background: transparent;
    border: 0;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 2px 7px rgba(8, 38, 64, 0.12);
  }

  body.is-mobile-sidebar-open .mobile-menu-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 24;
    display: block;
    visibility: hidden;
    background: rgba(5, 18, 33, 0.26);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 180ms ease,
      visibility 180ms ease;
  }

  body.is-mobile-sidebar-open .mobile-sidebar-backdrop {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-sidebar-backdrop[hidden] {
    display: none;
  }

  .mobile-sidebar-rail {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 25;
    display: block;
    width: var(--mobile-sidebar-width);
    height: var(--mobile-sidebar-page-height, 100vh);
    min-height: 100vh;
    min-height: 100dvh;
    visibility: hidden;
    background: rgba(49, 65, 55, 0.74);
    border-right: 1px solid rgba(255, 255, 255, 0.16);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 210ms ease,
      visibility 210ms ease;
  }

  body.is-mobile-sidebar-open .mobile-sidebar-rail {
    visibility: visible;
    opacity: 1;
  }

  .mobile-sidebar-rail[hidden] {
    display: none;
  }

  .app-shell {
    position: relative;
    width: 100% !important;
    height: var(--mobile-viewport-height, 100vh) !important;
    min-height: 0;
    max-height: var(--mobile-viewport-height, 100vh);
    padding-bottom: 0;
    flex-direction: row;
    overflow: hidden;
    transform: none;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    display: grid;
    width: var(--mobile-sidebar-width);
    min-width: var(--mobile-sidebar-width);
    height: var(--mobile-viewport-height, 100vh);
    max-height: var(--mobile-viewport-height, 100vh);
    padding-top: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: transparent;
    border-right: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom: 0;
    box-shadow: 12px 0 30px rgba(6, 29, 48, 0.18);
    transform: translateX(-105%);
    transition: transform 210ms ease;
  }

  body.is-mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .avatar-button {
    flex: none;
    display: block;
    width: var(--mobile-sidebar-logo-size);
    height: var(--mobile-sidebar-logo-size);
    min-height: var(--mobile-sidebar-logo-size);
    margin: 38px auto 22px;
    border-radius: 50%;
  }

  .sidebar > .sidebar-actions {
    display: flex;
    padding: 7px 0 calc(8px + env(safe-area-inset-bottom));
    margin-top: 0 !important;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .side-action {
    display: grid;
    width: 100%;
    height: var(--mobile-sidebar-action-height);
    place-items: center;
  }

  .side-action svg {
    width: var(--mobile-sidebar-icon-size);
    height: var(--mobile-sidebar-icon-size);
    stroke-width: 1.8;
  }

  .category-nav {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: clamp(34px, 8vh, 92px);
    scrollbar-width: none;
  }

  .category-nav::-webkit-scrollbar {
    display: none;
  }

  .category-button {
    min-width: 0;
    height: var(--mobile-sidebar-item-height);
    min-height: var(--mobile-sidebar-item-height);
    padding: 3px 1px 2px;
    gap: 2px;
    font-size: var(--mobile-sidebar-text-size);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .category-button svg {
    width: var(--mobile-sidebar-icon-size);
    height: var(--mobile-sidebar-icon-size);
    stroke-width: 1.8;
  }

  .category-icon-image {
    width: var(--mobile-sidebar-icon-size);
    height: var(--mobile-sidebar-icon-size);
  }

  .content {
    width: 100%;
    height: var(--mobile-viewport-height, 100vh);
    min-height: 0;
    max-height: var(--mobile-viewport-height, 100vh);
    overflow: hidden;
  }

  .theme-toggle {
    top: 30px;
    right: 31px;
  }

  .minimal-actions {
    top: 28px;
    right: 29px;
    gap: 14px;
  }

  .minimal-actions button,
  .minimal-actions svg {
    width: 24px;
    height: 24px;
  }

  .theme-toggle svg {
    width: 24px;
    height: 24px;
  }

  .clock-panel {
    margin-top: 92px;
  }

  .clock-panel,
  .search-bar,
  .link-grid {
    transform: none;
  }

  body.is-minimal .clock-panel {
    margin-top: 150px;
  }

  body.is-minimal .search-bar {
    margin-top: 45px;
  }

  .clock {
    font-size: 78px;
    letter-spacing: 0;
  }

  .calendar {
    font-size: 20px;
  }

  .search-bar {
    width: min(calc(100% - 64px), 560px);
    height: 58px;
    min-height: 58px;
    margin-top: 42px;
    border-radius: 34px;
  }

  .engine-button {
    width: 78px;
    padding-left: 18px;
    gap: 8px;
  }

  .engine-button img {
    width: 30px;
    height: 30px;
  }

  .engine-chevron {
    width: 18px;
  }

  .search-bar input {
    padding-left: 0;
    font-size: 18px;
  }

  .search-submit {
    width: 56px;
  }

  .search-submit svg {
    width: 31px;
    height: 31px;
  }

  .engine-menu {
    top: calc(100% + 10px);
    min-height: 0;
    padding: 15px 16px 14px;
    border-radius: 30px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px 7px;
  }

  .engine-option {
    padding: 7px 0 6px;
    gap: 8px;
    font-size: 15px;
  }

  .engine-option img {
    width: 51px;
    height: 51px;
    padding: 9px;
    border-radius: 15px;
  }

  .engine-option img[src$="douyin-logo.svg"] {
    padding: 9px;
  }

  .engine-option img[src$="zhihu.svg"] {
    padding: 5px;
  }

  .link-grid {
    width: min(calc(100% - 56px), 620px);
    margin-top: 36px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 14px;
    row-gap: 26px;
    flex: 1 1 auto;
    min-height: 0;
    align-content: start;
    justify-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .link-grid::-webkit-scrollbar {
    display: none;
  }

  .link-icon {
    width: 66px;
    height: 66px;
    border-radius: 16px;
  }

  .link-name {
    max-width: 86px;
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.18;
  }
}

@media (max-width: 480px) {
  .clock-panel {
    margin-top: 88px;
  }

  .clock {
    font-size: 68px;
  }

  .calendar {
    font-size: 18px;
  }

  .search-bar {
    width: min(calc(100% - 52px), 520px);
    height: 54px;
    min-height: 54px;
    margin-top: 38px;
  }

  .engine-button {
    width: 70px;
    padding-left: 16px;
    gap: 6px;
  }

  .engine-button img {
    width: 28px;
    height: 28px;
  }

  .engine-chevron {
    width: 16px;
  }

  .search-bar input {
    font-size: 17px;
  }

  .search-submit {
    width: 50px;
  }

  .search-submit svg {
    width: 29px;
    height: 29px;
  }

  .link-grid {
    width: min(calc(100% - 44px), 500px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 24px;
  }

  .link-icon {
    width: 58px;
    height: 58px;
    border-radius: 15px;
  }

  .link-name {
    max-width: 78px;
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  .clock {
    font-size: 60px;
  }

  .calendar {
    font-size: 16px;
  }

  .search-bar {
    width: calc(100% - 36px);
    height: 50px;
    min-height: 50px;
  }

  .engine-button {
    width: 62px;
    padding-left: 13px;
  }

  .search-bar input {
    font-size: 16px;
  }

  .search-submit {
    width: 46px;
  }

  .link-grid {
    width: calc(100% - 32px);
    column-gap: 8px;
    row-gap: 22px;
  }

  .link-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .link-name {
    max-width: 68px;
    font-size: 13px;
  }
}
