/*
实现原理：定义首页帖子列表、封面、分页和版本号的视觉样式。
如何使用：index.html 在 styles.css 后加载，本文件样式由 app_views.js 渲染节点使用。
*/

.posts {
  display: grid;
  gap: 10px;
}

.post-item {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  align-items: center;
  cursor: pointer;
}

.zip-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  margin: -2px 0 10px;
}

.zip-filter[hidden] {
  display: none;
}

.zip-filter label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
  color: #5f657d;
  font-size: 13px;
}

.zip-filter input,
.zip-filter select {
  width: min(100%, 92px);
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.zip-filter select {
  width: min(100%, 96px);
}

.zip-filter button {
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 8px;
}

.zip-filter button[type="submit"] {
  grid-column: 1;
}

#zip-filter-reset {
  grid-column: 2;
}

.toolbar-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.zip-filter-status {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(71, 66, 233, 0.18);
  border-radius: 999px;
  background: rgba(71, 66, 233, 0.08);
  color: var(--accent);
  font-size: 12px;
  box-shadow: none;
}

.post-item:hover {
  border-color: #c6c9ff;
}

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

.post-cover {
  position: relative;
  border: 1px solid var(--line);
  background: #f1f3ff;
  border-radius: 12px;
  overflow: hidden;
  width: 156px;
  height: 104px;
  padding: 0;
  min-height: 0;
}

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

.post-cover-media {
  display: block;
  width: 100%;
  height: 100%;
}

.post-cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background:
    radial-gradient(circle at 25% 22%, rgba(71, 66, 233, 0.16), transparent 22%),
    linear-gradient(135deg, #f4f3ff, #ebeafd);
  color: #5f5c89;
  font-size: 12px;
  font-weight: 600;
}

.post-cover-default {
  width: 58%;
  height: auto;
  fill: none;
  stroke: rgba(71, 66, 233, 0.5);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.privacy-cover-placeholder {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  background: #dfe8de;
}

.privacy-cover-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.92) brightness(0.96);
  transform: scale(1.01);
}

.post-cover-count {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  color: #fff;
  background: rgba(71, 66, 233, 0.9);
  line-height: 1.4;
}

.post-content {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.post-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 700;
}

.post-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: #69708a;
  font-size: 13px;
  line-height: 1.5;
}

.post-time,
.post-zip-size {
  min-width: 0;
  white-space: nowrap;
}

.post-zip-size {
  flex-shrink: 0;
  text-align: right;
}

.post-actions-menu {
  flex-shrink: 0;
}

.post-actions-summary {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(71, 66, 233, 0.12);
  border-radius: 999px;
  background: rgba(71, 66, 233, 0.06);
  color: var(--accent);
  box-shadow: none;
}

.post-actions-summary .action-icon {
  display: inline-grid;
  place-items: center;
}

.post-actions-summary .ui-icon {
  width: 18px;
  height: 18px;
}

.post-actions-menu.is-collapsed.is-open > .post-actions-panel {
  min-width: 172px;
}

.post-actions-menu.is-collapsed.is-open .post-delete-btn {
  margin-top: 2px;
  border-color: rgba(225, 29, 72, 0.16);
  background: rgba(225, 29, 72, 0.06);
  color: var(--danger);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.pager button {
  min-width: 56px;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--accent-border);
  background: linear-gradient(135deg, #f8f7ff, #ebeaff);
  color: var(--accent);
  box-shadow: 0 8px 20px rgba(71, 66, 233, 0.1);
}

.pager .ui-icon {
  width: 16px;
  height: 16px;
}

.home-version {
  margin: 18px 0 8px;
  color: #69708a;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 720px) {
  .post-item {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .post-cover {
    width: 100%;
    height: 44vw;
    max-height: 220px;
  }
}
