/* ==========================================================================
   Ukusil · 首页
   导航之下的白纸、标记与搜索。其余留白。
   ========================================================================== */

body.home {
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(ellipse 68% 54% at 50% 44%, #ffffff 24%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(180deg, #ffffff 0%, #fdfdfd 58%, #fafbfb 100%);
}

.home-stage {
  display: flex;
  width: 100%;
  min-height: calc(100vh - var(--site-header-height));
  min-height: calc(100svh - var(--site-header-height));
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 54px 24px 76px;
}

.home-lockup {
  display: flex;
  width: min(100%, 760px);
  flex-direction: column;
  align-items: center;
  transform: translateY(-1.4vh);
  animation: home-arrive 0.58s cubic-bezier(0.22, 0.72, 0.2, 1) both;
}

@keyframes home-arrive {
  from {
    opacity: 0;
    transform: translateY(calc(-1.4vh + 9px));
  }
  to {
    opacity: 1;
    transform: translateY(-1.4vh);
  }
}

.home-mark {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.home-wordmark {
  width: min(440px, 45vw);
  margin: 0;
  line-height: 0;
}

.home-wordmark img {
  display: block;
  width: 100%;
  height: auto;
}

/* --------------------------------- 搜索 ---------------------------------- */

.search-area {
  position: relative;
  width: 100%;
  max-width: 616px;
  margin-top: clamp(38px, 5.8vh, 58px);
}

.search-form {
  display: flex;
  min-height: 60px;
  align-items: center;
  padding: 7px 8px 7px 18px;
  border: 1px solid #cdd1d7;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(18, 19, 22, 0.035);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.search-form:hover {
  border-color: #b7bcc3;
}

.search-form:focus-within {
  border-color: var(--ink);
  box-shadow:
    0 0 0 4px rgba(18, 19, 22, 0.055),
    0 14px 36px rgba(18, 19, 22, 0.055);
}

.search-leading {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-right: 11px;
  color: #686e77;
  transition: color 160ms ease;
}

.search-form:focus-within .search-leading {
  color: var(--ink);
}

.search-input {
  width: 100%;
  min-width: 0;
  height: 44px;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  font-weight: 400;
  letter-spacing: 0.002em;
  line-height: 1.4;
  caret-color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: #6a7079;
  opacity: 1;
}

.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
}

.search-submit {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 11px;
  background: var(--ink);
  color: var(--primary-ink);
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.search-submit:hover {
  border-color: #2c3036;
  background: #2c3036;
}

.search-submit:active {
  transform: scale(0.96);
}

.search-submit:focus-visible {
  outline-offset: 2px;
}

/* -------------------------------- 联想面板 -------------------------------- */

.suggestion-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid #dcdfe4;
  border-radius: 14px;
  background: #ffffff;
  box-shadow:
    0 24px 56px rgba(18, 19, 22, 0.115),
    0 3px 10px rgba(18, 19, 22, 0.045);
  animation: panel-arrive 150ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.suggestion-panel[hidden] {
  display: none;
}

@keyframes panel-arrive {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.suggestion-list {
  max-height: min(57vh, 388px);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid #eceef1;
  cursor: pointer;
  transition: background 100ms ease;
}

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

.suggestion-item:hover,
.suggestion-item[aria-selected="true"] {
  background: #f5f6f7;
}

.suggestion-glyph {
  display: inline-flex;
  width: 18px;
  height: 22px;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  color: #9298a1;
}

.suggestion-item[aria-selected="true"] .suggestion-glyph {
  color: #30343a;
}

.suggestion-copy {
  min-width: 0;
  flex: 1;
}

.suggestion-title {
  display: block;
  overflow: hidden;
  color: #17191c;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.004em;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-copy mark {
  padding: 0 1px;
  border-radius: 2px;
  background: #f5edcf;
  color: inherit;
  font-weight: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.suggestion-meta {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
  color: #6a7079;
  font-size: 12px;
  line-height: 1.45;
}

.suggestion-section {
  flex: 0 0 auto;
  color: #5e656e;
}

.suggestion-divider {
  flex: 0 0 auto;
  color: #b4b9c0;
}

.suggestion-snippet {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-chevron {
  flex: 0 0 auto;
  margin-top: 4px;
  color: #b1b6bd;
  opacity: 0;
  transform: translateX(-3px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.suggestion-item:hover .suggestion-chevron,
.suggestion-item[aria-selected="true"] .suggestion-chevron {
  opacity: 1;
  transform: translateX(0);
}

.suggestion-empty {
  padding: 28px 24px 24px;
  text-align: center;
}

.suggestion-empty[hidden] {
  display: none;
}

.suggestion-empty-title {
  margin: 0 0 5px;
  color: #202328;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.003em;
}

.suggestion-empty-text {
  margin: 0;
  color: #6a7079;
  font-size: 12.5px;
  line-height: 1.6;
}

.suggestion-create {
  display: inline-flex;
  margin-top: 15px;
  padding: 7px 13px;
  border: 1px solid #17191c;
  border-radius: 6px;
  background: #17191c;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition:
    background 120ms ease,
    border-color 120ms ease;
}

.suggestion-create[hidden] {
  display: none;
}

.suggestion-create:hover {
  border-color: #2c3036;
  background: #2c3036;
  color: #ffffff;
}

.search-all {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border: 0;
  border-top: 1px solid #eceef1;
  background: #fcfcfd;
  color: #656b74;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: left;
  transition:
    background 120ms ease,
    color 120ms ease;
}

.search-all:hover {
  background: #f5f6f7;
  color: var(--ink);
}

.search-all-hint {
  flex: 0 0 auto;
  padding: 1px 5px;
  border: 1px solid #e2e4e8;
  border-radius: 4px;
  background: #ffffff;
  color: #8a9099;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.045em;
  line-height: 1.6;
}

/* -------------------------------- 响应式 --------------------------------- */

@media (max-width: 860px) {
  .home-stage {
    align-items: flex-start;
    padding: max(9vh, 68px) 20px 42px;
  }

  .home-lockup {
    transform: none;
    animation-name: home-arrive-mobile;
  }

  @keyframes home-arrive-mobile {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .home-wordmark {
    width: min(74vw, 334px);
  }

  .search-area {
    max-width: 100%;
    margin-top: clamp(34px, 6vh, 46px);
  }
}

@media (max-width: 640px) {
  .home-stage {
    padding-right: 18px;
    padding-left: 18px;
  }

  .home-wordmark {
    width: min(78vw, 320px);
  }

  .search-form {
    min-height: 57px;
    padding: 6px 6px 6px 15px;
    border-radius: 13px;
  }

  .search-leading {
    margin-right: 9px;
  }

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

  .search-submit {
    width: 43px;
    height: 43px;
    border-radius: 10px;
  }

  .suggestion-panel {
    border-radius: 13px;
  }

  .suggestion-list {
    max-height: min(50vh, 350px);
  }

  .suggestion-item {
    padding: 11px 14px;
  }

  .suggestion-chevron {
    display: none;
  }

  .search-all {
    padding: 10px 14px;
  }
}

@media (max-width: 380px) {
  .home-stage {
    padding-right: 14px;
    padding-left: 14px;
  }

  .suggestion-snippet {
    display: none;
  }

  .suggestion-divider {
    display: none;
  }

  .search-all-hint {
    display: none;
  }
}

@media (max-height: 660px) and (min-width: 861px) {
  .home-stage {
    padding-top: 26px;
    padding-bottom: 26px;
  }

  .home-wordmark {
    width: 350px;
  }

  .search-area {
    margin-top: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* -------------------------------- 个人待办 -------------------------------- */

.home-stage {
  position: relative;
}

.home-side {
  position: absolute;
  top: 50%;
  left: max(24px, calc((100vw - 1160px) / 2));
  width: 220px;
  max-height: calc(100svh - var(--site-header-height) - 52px);
  padding-left: 20px;
  overflow-y: auto;
  border-left: 1px solid var(--line-soft);
  transform: translateY(-50%);
  scrollbar-width: thin;
}

.home-side-eyebrow {
  margin: 0 0 3px;
  color: #8a9099;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.home-side h2 {
  margin: 0 0 22px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.home-side-group {
  margin-top: 22px;
}

.home-side-group[hidden] {
  display: none;
}

.home-side-group h3 {
  margin: 0 0 8px;
  color: #8a9099;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.home-pinned {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfbfc;
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 130ms ease,
    background 130ms ease;
}

.home-pinned:hover {
  border-color: var(--line-strong);
  background: #f6f7f8;
  color: var(--ink);
}

.home-pinned-star {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.6;
}

.home-pinned-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.home-pinned-copy strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-pinned-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-side-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-side-list li {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.home-side-list a {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-side-list a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-side-list span {
  flex: 0 0 auto;
  color: #8a9099;
  font-size: 9.5px;
  white-space: nowrap;
}

.home-side-note {
  margin: 28px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
  color: #8a9099;
  font-size: 10.5px;
  line-height: 1.7;
}

.home-side-note a {
  color: var(--ink-soft);
  text-underline-offset: 2px;
}

@media (max-width: 1200px) {
  .home-stage {
    flex-direction: column;
    justify-content: flex-start;
  }

  .home-lockup {
    order: 1;
  }

  .home-side {
    position: static;
    order: 2;
    width: 100%;
    max-width: 616px;
    max-height: none;
    margin-top: 38px;
    padding: 22px 0 0;
    overflow: visible;
    border-top: 1px solid var(--line-soft);
    border-left: 0;
    transform: none;
  }

  .home-side h2 {
    margin-bottom: 16px;
  }

  .home-side-group {
    margin-top: 16px;
  }
}

.home-side-count {
  margin-left: 4px;
  color: #a0a5ad;
  font-size: 9px;
  letter-spacing: 0.02em;
}

.home-pinned + .home-pinned {
  margin-top: 6px;
}
