html, body {
  scrollbar-width: auto;
  scrollbar-color: rgba(142, 160, 207, 0.9) transparent;
}

body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

body::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background: rgba(142, 160, 207, 0.72);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

body::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:active,
*::-webkit-scrollbar-thumb:active {
  background: rgba(142, 160, 207, 0.96);
  border: 1px solid transparent;
}

body::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
  background: transparent;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 16px);
}

.page {
  width: 100%;
}

.page__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px var(--page-padding) 24px;
}

.hero-card,
.panel,
.result-card,
.empty-card,
.debug-card,
.directory-card,
.weibo-entry {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-soft);
}

.hero-card {
  padding: 16px 14px;
}

.hero-card__title {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 800;
}

.hero-card__desc {
  margin: 6px 0 0;
  color: var(--text-soft);
}

.search-box {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.search-box__input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 14px 16px;
  color: var(--text);
}

.search-box button,
.primary-button,
.secondary-button,
.tag,
.nav-item,
.link-button,
.classic-grid__item,
.month-toggle,
.directory-row {
  cursor: pointer;
}

.search-box button,
.primary-button {
  background: var(--accent);
  color: #fff;
  border-radius: 16px;
  padding: 0 16px;
  font-weight: 700;
}

.panel {
  margin-top: 18px;
  padding: 14px;
}

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

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.segmented button {
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--text-soft);
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--accent-deep);
  font-weight: 700;
}

.panel__header--search-tags {
  align-items: center;
}

.search-tags-toggle {
  white-space: nowrap;
  font-size: 14px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}

.results,
.directory-list,
.weibo-months {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.result-card {
  padding: 18px;
}

.result-card[data-open-detail] {
  cursor: pointer;
}

.result-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.pill {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
}

.result-card__title {
  margin: 0;
  font-size: 19px;
  line-height: 1.45;
}

.result-card__context {
  margin: 12px 0 0;
  color: var(--text-body);
}

.result-card__line + .result-card__line {
  margin-top: 8px;
}

.result-card__muted {
  color: var(--text-soft);
}

.result-card__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.link-button {
  color: var(--accent-deep);
  font-weight: 700;
}

.empty-card,
.debug-card {
  margin-top: 18px;
  padding: 18px;
}

.classic-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.classic-grid__item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 14px 12px;
  text-align: center;
}

.classic-grid__icon {
  font-size: 24px;
  line-height: 1;
}

.classic-grid__title {
  margin-top: 8px;
  font-weight: 700;
  line-height: 1.3;
}

.directory-card,
.weibo-entry {
  padding: 16px;
}

.directory-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 2px;
}

.directory-row__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-deep);
  flex: 0 0 auto;
}

.directory-row__title {
  flex: 1;
  font-weight: 700;
  line-height: 1.35;
}

.directory-row__arrow,
.month-toggle__arrow {
  color: var(--text-soft);
}

.directory-divider {
  margin-left: 18px;
  border-top: 1px solid var(--line);
}

.directory-group {
  margin-top: 18px;
}

.directory-group__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--accent-deep);
  font-weight: 800;
}

.directory-group__heading::before,
.directory-group__heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.month-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.month-toggle__title {
  font-weight: 800;
  color: var(--accent-deep);
}

.weibo-entry__title {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 800;
}

.weibo-entry__content {
  color: var(--text-body);
  white-space: pre-wrap;
}

.weibo-entry__image {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.98);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.07);
}

.bottom-nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--nav-height);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0 max(var(--page-padding), 8px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

.nav-item__icon {
  font-size: 18px;
  line-height: 1;
}

.nav-item__icon-image {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.nav-item__label {
  line-height: 1.1;
}

.nav-item.is-active {
  color: var(--accent-deep);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}
.classic-loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(142, 160, 207, 0.28);
  border-top-color: var(--accent-deep);
  animation: loading-spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.loading-spinner--sm {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
}

.detail-loading-card {
  display: flex;
  justify-content: center;
  padding: 8px 0 0;
}

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

.status-row > :first-child {
  min-width: 0;
  flex: 1;
}

.status-row > :last-child {
  white-space: nowrap;
  color: var(--accent-deep);
}

.inline-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent-deep);
  font-size: 13px;
  vertical-align: middle;
}

.title-copy-button {
  margin-left: 8px;
}

.results-more-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.results-more-button {
  min-width: 120px;
  padding: 10px 20px;
  border-radius: 999px;
}

.action-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 28px);
  transform: translateX(-50%);
  z-index: 30;
  margin: 0;
  padding: 12px 16px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  border: 0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.detail-panel {
  overflow: hidden;
}

.detail-paragraph + .detail-paragraph {
  margin-top: 14px;
}

.detail-image-wrap img,
.weibo-entry__image img {
  display: block;
  width: 100%;
  height: auto;
}

.detail-image-error {
  padding: 18px;
  text-align: center;
  color: var(--text-soft);
  background: var(--bg-soft);
}

.search-box__clear {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: transparent;
  color: #7b8db7;
  border: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.search-box__clear.is-visible {
  display: inline-flex;
}

.search-input--clearable {
  padding-right: 42px;
}

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

.search-input--clearable::-webkit-search-decoration {
  -webkit-appearance: none;
}

.floating-top-button {
  position: fixed;
  right: 16px;
  bottom: calc(var(--nav-height) + 22px);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(147, 197, 253, 0.18);
  color: #6b8fd6;
  box-shadow: 0 8px 20px rgba(147, 197, 253, 0.16);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(147, 197, 253, 0.28);
  backdrop-filter: blur(8px);
}

.floating-top-button.is-visible {
  display: inline-flex;
}

.detail-back {
  display: inline-flex;
  margin: 0 0 10px 0;
}

mark {
  background: #fff1a8;
  color: inherit;
  padding: 0 1px;
}

@media (min-width: 768px) {
  .hero-card {
    padding: 18px;
  }

  .page__inner {
    padding-top: 16px;
  }

  .classic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
