/* 消息 Tab：布局对齐微信（顶栏灰、搜索灰底、列表白、分割线从头像右侧起） */

.view--msgs .view__body {
  background: var(--bar-bg);
}

.view--msgs .navbar {
  background: var(--bar-bg);
  box-shadow: none;
}

.icon--nav {
  width: 28px;
  height: 28px;
  stroke-width: 1.5;
}

.msgs-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 4px 8px 8px;
  background: var(--bar-bg);
}

.search-field {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-plain);
}

.search-field__icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--text-2);
  stroke-width: 2.2;
}

.search-field__input {
  flex: 0 1 auto;
  width: 2.8em;
  max-width: calc(100% - 24px);
  height: 36px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 36px;
  text-align: center;
}

.search-field__input::placeholder {
  color: var(--text-2);
}

/* 聚焦或已有内容：占满一行、左对齐输入 */
.search-field:focus-within,
.search-field:has(.search-field__input:not(:placeholder-shown)) {
  justify-content: flex-start;
  padding: 0 10px;
  gap: 6px;
}

.search-field:focus-within .search-field__input,
.search-field:has(.search-field__input:not(:placeholder-shown)) .search-field__input {
  flex: 1;
  width: auto;
  text-align: left;
}

.search-field__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.msgs-list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--bg-plain);
}

.view--msgs .cell {
  position: relative;
  min-height: 64px;
  padding: 8px 0 8px 16px;
  gap: 12px;
  align-items: stretch;
  background: var(--bg-plain);
}

.view--msgs .cell:active {
  background: #ececec;
}

[data-theme="dark"] .view--msgs .cell:active {
  background: var(--fill);
}

.view--msgs .cell .avatar {
  --size: 48px;
  border-radius: 4px;
}

.view--msgs .cell__avatar {
  align-self: center;
}

.view--msgs .cell__main {
  justify-content: center;
  padding-right: 16px;
  gap: 4px;
  box-shadow: none;
}

/* 分割线贴在整行底边（行与行之间），从头像右侧到屏幕右缘 */
.view--msgs .cell::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: calc(16px + 48px + 12px);
  height: 1px;
  background: var(--separator);
  transform: scaleY(0.5);
  transform-origin: 0 100%;
  pointer-events: none;
}

.view--msgs li:last-child .cell::after {
  display: none;
}

.view--msgs .cell__row {
  align-items: center;
  gap: 12px;
}

.view--msgs .cell__title {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.35;
}

.view--msgs .cell__meta {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-2);
}

.view--msgs .cell__sub {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-2);
}

/* 未读：头像右上角小红点/数字，无白边 */
.cell__avatar {
  position: relative;
  flex: none;
  align-self: center;
}

.cell__avatar .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 0;
  border-radius: 999px;
  background: var(--badge);
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 500;
  line-height: 16px;
  text-align: center;
  box-sizing: border-box;
}

.cell__avatar .badge[hidden] {
  display: none !important;
}
