/* ========== 首页快捷搜索与最近访问 ========== */
.home-quick-access {
  display: grid;
  gap: 18px;
  margin-top: 24px;
  padding: 24px;
  border-radius: var(--shell-radius-xl);
  border: 1px solid rgba(var(--shell-accent-rgb), 0.14);
  background:
    linear-gradient(
      180deg,
      rgba(var(--shell-surface-rgb), 0.94),
      rgba(var(--shell-surface-rgb), 0.78)
    ),
    radial-gradient(
      circle at top left,
      rgba(var(--shell-accent-rgb), 0.08),
      transparent 42%
    );
}

.home-quick-access__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.home-quick-access__eyebrow,
.home-search-dialog__eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--shell-accent);
  font-weight: 700;
}

.home-quick-access__title,
.home-search-dialog h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.home-quick-access__description {
  margin: 8px 0 0;
  color: var(--shell-muted);
  line-height: 1.75;
}

.home-command-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(var(--shell-accent-rgb), 0.18);
  border-radius: 999px;
  color: var(--shell-text);
  background: var(--shell-subtle-surface-strong);
  box-shadow: var(--shell-shadow-soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.home-command-button:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--shell-accent-rgb), 0.32);
  box-shadow: var(--shell-shadow);
}

.home-command-button kbd {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(var(--shell-accent-rgb), 0.18);
  color: var(--shell-muted);
  background: rgba(var(--shell-surface-strong-rgb), 0.76);
  font-size: 12px;
  font-family: inherit;
}

.home-recent-panel {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(var(--shell-accent-rgb), 0.12);
}

.home-recent-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-recent-panel__header h3 {
  margin: 0;
  font-size: 1rem;
}

.home-recent-panel__header button {
  border: 0;
  color: var(--shell-accent);
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.home-recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-recent-item {
  display: inline-grid;
  gap: 2px;
  min-width: min(220px, 100%);
  padding: 12px 14px;
  border: 1px solid rgba(var(--shell-accent-rgb), 0.14);
  border-radius: 16px;
  color: inherit;
  background: rgba(var(--shell-surface-strong-rgb), 0.66);
  text-decoration: none;
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    background 200ms ease;
}

.home-recent-item:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--shell-accent-rgb), 0.28);
  background: rgba(var(--shell-surface-strong-rgb), 0.88);
}

.home-recent-item__title {
  font-weight: 800;
}

.home-recent-item__meta {
  color: var(--shell-muted);
  font-size: 0.86rem;
}

.home-search-open {
  overflow: hidden;
}

.home-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(7vh, 56px) 18px 32px;
  background: rgba(var(--shell-overlay-rgb), 0.46);
  backdrop-filter: blur(12px);
}

.home-search-overlay[hidden] {
  display: none;
}

.home-search-dialog {
  width: min(760px, 100%);
  max-height: calc(100vh - min(14vh, 112px) - 32px);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(var(--shell-accent-rgb), 0.18);
  border-radius: var(--shell-radius-xl);
  background: var(--shell-card-surface);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.24);
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.home-search-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.home-search-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 1px solid rgba(var(--shell-accent-rgb), 0.14);
  border-radius: 999px;
  color: var(--shell-text);
  background: rgba(var(--shell-surface-strong-rgb), 0.76);
  cursor: pointer;
  font-size: 1.15rem;
  box-shadow: var(--shell-shadow-soft);
}

.home-search-dialog__close .fa {
  width: 1.15em;
  height: 1.15em;
}

.home-search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid rgba(var(--shell-accent-rgb), 0.18);
  border-radius: 18px;
  background: rgba(var(--shell-surface-strong-rgb), 0.82);
  color: var(--shell-muted);
}

.home-search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--shell-text);
  background: transparent;
  font: inherit;
  font-size: 1rem;
}

.home-search-results {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 2px 12px 10px 2px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.home-search-result {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 96px;
  padding: 16px;
  border: 1px solid rgba(var(--shell-accent-rgb), 0.12);
  border-radius: 18px;
  color: var(--shell-text);
  background: rgba(var(--shell-surface-strong-rgb), 0.62);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.home-search-result:hover {
  border-color: rgba(var(--shell-accent-rgb), 0.36);
  background: rgba(var(--shell-surface-strong-rgb), 0.9);
  box-shadow: inset 0 0 0 1px rgba(var(--shell-accent-rgb), 0.14);
}

.home-search-result.is-active {
  border-color: rgba(var(--shell-accent-rgb), 0.72);
  background: rgba(var(--shell-accent-rgb), 0.14);
  box-shadow:
    inset 0 0 0 2px rgba(var(--shell-accent-rgb), 0.26),
    0 12px 28px rgba(var(--shell-accent-rgb), 0.12);
}

.home-search-result__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--shell-accent);
  background: rgba(var(--shell-accent-rgb), 0.1);
}

.home-search-result__icon .fa,
.home-search-result__icon .home-card__icon-svg {
  width: 18px;
  height: 18px;
}

.home-search-result__icon .home-card__icon-svg svg {
  width: 100%;
  height: 100%;
}

.home-search-result__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.home-search-result__body > strong,
.home-search-result__body > .home-search-result__meta,
.home-search-result__body > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-search-result__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.home-search-result__meta > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-search-result__meta,
.home-search-result__body small,
.home-search-dialog__hint,
.home-search-empty {
  color: var(--shell-muted);
}

.home-search-result__body strong {
  line-height: 1.3;
}

.home-search-result__body span {
  line-height: 1.35;
}

.home-search-result__body small {
  font-size: 0.9rem;
  line-height: 1.45;
}

.home-search-dialog__hint {
  margin: 0;
  font-size: 0.9rem;
}

.home-search-empty {
  padding: 24px;
  border: 1px dashed rgba(var(--shell-accent-rgb), 0.2);
  border-radius: 18px;
  text-align: center;
  background: rgba(var(--shell-surface-strong-rgb), 0.5);
}

@media (max-width: 720px) {
  .home-quick-access__header,
  .home-recent-panel__header {
    align-items: stretch;
    flex-direction: column;
  }

  .home-command-button {
    justify-content: center;
    width: 100%;
  }

  .home-search-overlay {
    align-items: stretch;
    padding: 12px;
  }

  .home-search-dialog {
    max-height: calc(100vh - 24px);
    padding: 20px;
  }

  .home-search-dialog__close {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .home-search-result {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .home-search-result > .fa-arrow-right {
    display: none;
  }
}
