/* 首页专属：个人简介、一言、博客列表、搜索、联系 */

/* 个人简介 */
.profile {
  display: flex;
  align-items: center;
  gap: 24px;
}

.avatar {
  flex: none;
  width: 96px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 2.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  object-fit: cover;
  transition:
    transform 100ms ease,
    box-shadow 100ms ease;
}

.avatar:hover {
  transform: scale(1.04);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.avatar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.profile-info h1 {
  margin-bottom: 4px;
  font-size: 1.5rem;
}

.role {
  margin: 0 0 var(--gap);
  color: var(--muted);
  font-size: 0.95rem;
}

.bio {
  margin: 0 0 var(--gap);
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills li {
  background: var(--chip);
  border-radius: var(--radius);
  padding: 4px 12px;
  font-size: 0.85rem;
  color: var(--muted);
  transition:
    background 100ms ease,
    color 100ms ease;
}

.skills li:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* 一言 */
.hitokoto {
  display: block;
  margin-top: var(--gap);
  padding: 8px 16px;
  background: var(--chip);
  border-left: 3px solid rgba(9, 105, 218, 0.35);
  border-radius: 0px var(--radius) var(--radius) 0px;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.4em;
  transition:
    background 100ms ease,
    color 100ms ease,
    border-color 100ms ease;
}

.hitokoto:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-left-color: var(--accent);
  opacity: 1;
}

.hitokoto:empty::before {
  content: "一言加载中…";
}

/* 一言加载完成后从左到右逐渐显示 */
.hitokoto-text {
  display: inline-block;
  animation: hitokoto-reveal 600ms ease-out both;
}

@keyframes hitokoto-reveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hitokoto-text {
    animation: none;
  }
}

/* 博客 */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--gap);
}

.section-head h2 {
  margin: 0;
}

.search-box {
  margin-bottom: var(--gap);
}

.search-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.search-option input {
  accent-color: var(--accent);
  cursor: pointer;
}

.search-option input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.search-option.is-loading .search-option-hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.search-option.is-failed .search-option-hint {
  color: #cf222e;
  font-size: 0.8rem;
}

html[data-theme="dark"] .search-option.is-failed .search-option-hint {
  color: #ff7b72;
}

.search-input {
  width: 100%;
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid var(--chip);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition:
    border-color 100ms ease,
    box-shadow 100ms ease;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

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

.tag-filter button {
  background: var(--card);
  color: var(--muted);
  border: none;
  border-radius: var(--radius);
  padding: 4px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition:
    background 100ms ease,
    color 100ms ease;
}

.tag-filter button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-filter button.active {
  background: var(--accent);
  color: #fff;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.post {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 100ms ease;
  animation: post-fade-in 500ms ease both;
}

@keyframes post-fade-in {
  from {
    opacity: 0;
    transform: translateY(-40px);
    margin-bottom: -40px;
  }
  to {
    opacity: 1;
    transform: translateY(0px);
  }
}

.post:hover {
  box-shadow: var(--shadow-hover);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.post h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.post h3 a {
  color: var(--text);
  transition: color 100ms ease;
}

.post h3 a:hover {
  color: var(--accent);
  opacity: 1;
}

.post p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.post-tags span {
  background: var(--chip);
  border-radius: var(--radius);
  padding: 2px 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.post-list-empty {
  color: var(--muted);
  text-align: center;
  padding: 32px 0;
}

.search-highlight {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  padding: 0 2px;
}

/* 联系 */
.contact h2 {
  margin-bottom: 8px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: var(--gap);
}

.links a {
  background: var(--chip);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 16px;
  font-size: 0.9rem;
  transition:
    background 100ms ease,
    color 100ms ease;
}

.links a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* 遗留样式：未知用途，暂存于此 */
.task-list-item-checkbox {
  position: relative;
}

.task-list-item-checkbox:checked::before {
  content: "";
  z-index: 1;
  border: solid white;
  width: 0.2em;
  height: 0.5em;
  margin: auto;
  inset-inline-start: 0.35em;
  border-width: 0 0.15em 0.15em 0;
  position: absolute;
  top: 0.2em;
  transform: rotate(45deg);
}

.task-list-item-checkbox::after {
  background-color: white;
  height: 1em;
  width: 1em;
  display: block;
  content: "";
  text-align: center;
  color: white;
  border: #0991dc solid 1.5px;
  border-radius: 0.2em;
}

.task-list-item-checkbox:checked::after {
  background-color: #0991dc;
}

/* 移动端适配（首页层） */
@media (max-width: 600px) {
  .profile {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .card,
  .post {
    padding: 16px;
  }
}
