/* —— 生活页：最新状态 / 发现行 / 近况历史 / 评论 —— */
.scroll-tab {
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  /* 顶栏删除后由滚动页自己承接顶部安全区 */
  padding: max(var(--md-gutter), env(safe-area-inset-top)) var(--md-gutter) var(--md-gutter);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  background-color: var(--md-surface);
}
.section-heading { padding: 4px 2px 16px; min-width: 0; }
.section-heading h1 { margin: 2px 0 4px; }
.section-heading > p:last-child {
  color: var(--md-on-surface-variant);
  font-size: var(--md-body-size); line-height: var(--md-body-line);
}

/* 最新状态 */
.latest-card h2 { margin-bottom: 8px; }
.latest-list { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.latest-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0;
  min-width: 0;
  border-bottom: 1px solid var(--md-outline-variant);
}
.latest-item:first-child { padding-top: 4px; }
.latest-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.latest-item.mine .avatar { background-color: var(--md-primary-container); color: var(--md-on-primary-container); }
.latest-body { min-width: 0; flex: 1; display: grid; gap: 4px; }
.latest-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  min-width: 0;
}
/* 长昵称必须能收缩省略，否则 320px 窄屏会把生活页撑出横向滚动 */
.latest-head b {
  flex: 1 1 auto; min-width: 0;
  font-size: var(--md-body-size); line-height: var(--md-body-line); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.latest-head time {
  color: var(--md-on-surface-variant);
  font-size: var(--md-label-size); line-height: var(--md-label-line);
  flex: none;
}
.latest-text { font-size: var(--md-body-size); line-height: var(--md-body-line); overflow-wrap: anywhere; }
.latest-place {
  display: flex; align-items: center; gap: 6px;
  color: var(--md-on-surface-variant);
  font-size: var(--md-label-size); line-height: var(--md-label-line);
  overflow-wrap: anywhere;
}
.latest-place::before {
  content: ""; width: 6px; height: 6px; flex: none;
  border-radius: 50%;
  background-color: var(--md-tertiary);
}
.latest-photo {
  display: block; width: 100%; max-height: 200px;
  object-fit: cover;
  margin-top: 4px;
  border-radius: var(--md-shape-md);
  background-color: var(--md-surface-container-high);
  opacity: var(--img-opacity);
  outline: var(--img-outline);
  outline-offset: -1px;
}

/* 发现式横条（最近在做什么 / 查询对方位置 / 权限） */
.discover { padding: 0; overflow: hidden; }
.discover-row {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 64px;
  padding: 12px var(--md-gutter);
  border: 0;
  background-color: transparent;
  color: var(--md-on-surface);
  text-align: left;
  min-width: 0;
  transition: background-color var(--md-dur) var(--md-ease);
}
.discover-row + .discover-row { border-top: 1px solid var(--md-outline-variant); }
/* 新版结构里发现行同时带 .list-item：分隔线只留一条（行间的 border-top） */
.list-item.discover-row:not(:last-child)::after { display: none; }
.discover-row:active { background-color: var(--md-state-press); }
.discover-icon {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background-color: var(--md-primary-container);
  color: var(--md-on-primary-container);
}
.discover-icon svg { width: 20px; height: 20px; }
.discover-label {
  flex: none;
  font-size: var(--md-title-size); line-height: var(--md-title-line); font-weight: 500;
}
.discover-value {
  margin-left: auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--md-on-surface-variant);
  font-size: var(--md-body-size); line-height: var(--md-body-line);
  max-width: 46%;
}

/* 详情页（近况 / 查询位置 / 权限） */
.detail { flex: 1; min-height: 0; }
.detail-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 12px 4px;
  min-width: 0;
}
.detail-head h1 {
  font-size: var(--md-headline-size); line-height: var(--md-headline-line);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 发布近况表单 */
.activity-list { display: grid; gap: 12px; margin-top: 12px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.activity-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px;
  border-radius: var(--md-shape-md);
  background-color: var(--md-surface-container-low);
  min-width: 0;
}
.activity-item.mine { background-color: var(--md-surface-container); }
.activity-body { min-width: 0; flex: 1; display: grid; gap: 4px; }
.activity-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  min-width: 0;
}
/* 昵称必须可收缩省略，否则长昵称会把列表撑出横向滚动 */
.activity-head b {
  flex: 1 1 auto; min-width: 0;
  font-size: var(--md-body-size); line-height: var(--md-body-line); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.activity-head time {
  color: var(--md-on-surface-variant);
  font-size: var(--md-label-size); line-height: var(--md-label-line);
  flex: none;
}
.activity-text { font-size: var(--md-body-size); line-height: var(--md-body-line); overflow-wrap: anywhere; }
.activity-place { color: var(--md-on-surface-variant); font-size: var(--md-label-size); line-height: var(--md-label-line); overflow-wrap: anywhere; }
.activity-photo-button {
  display: block; margin-top: 6px; padding: 0;
  border: 0; border-radius: var(--md-shape-md);
  overflow: hidden;
  background-color: var(--md-surface-container-high);
  max-width: 100%;
}
.activity-photo {
  display: block;
  width: min(100%, 240px); max-height: 200px;
  object-fit: cover;
  opacity: var(--img-opacity);
  outline: var(--img-outline);
  outline-offset: -1px;
}
.activity-photo-preview {
  display: block; width: 100%; max-height: 210px;
  object-fit: cover;
  margin-top: 8px;
  border-radius: var(--md-shape-md);
  background-color: var(--md-surface-container-high);
  opacity: var(--img-opacity);
  outline: var(--img-outline);
  outline-offset: -1px;
}
/* 评论 */
.activity-comments {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--md-outline-variant);
  display: grid; gap: 6px;
}
.comment-item { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.comment-body {
  min-width: 0; flex: 1;
  padding: 6px 10px;
  border-radius: var(--md-shape-xs) var(--md-shape-md) var(--md-shape-md) var(--md-shape-md);
  background-color: var(--md-surface-container-high);
}
.comment-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.comment-head b { font-size: var(--md-label-size); line-height: var(--md-label-line); font-weight: 500; }
.comment-head time { color: var(--md-on-surface-variant); font-size: 11px; line-height: 14px; }
.comment-text { margin-top: 2px; font-size: var(--md-label-size); line-height: var(--md-label-line); overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 8px; margin-top: 4px; min-width: 0; }
.comment-form input {
  flex: 1; min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--md-shape-full);
}
.comment-form button { flex: none; min-height: 40px; padding: 0 16px; }
.activity-item-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
.activity-delete {
  padding: 4px 0;
  border: 0; background: none;
  color: var(--md-error);
  font-size: var(--md-label-size); line-height: var(--md-label-line);
  text-decoration: underline; text-underline-offset: 3px;
}
.activity-delete.armed {
  padding: 4px 10px;
  border-radius: var(--md-shape-sm);
  background-color: var(--md-error);
  color: var(--md-on-error);
  text-decoration: none;
  font-weight: 500;
}
#activity-more { margin-top: 12px; }

/* 发布行：照片按钮可收缩、发布按钮固定不被压缩（320px 不横向溢出） */
.publish-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-width: 0; }
.publish-row .file-button {
  flex: 0 1 auto; min-width: 0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.publish-row .text-button { flex: none; white-space: nowrap; }
.publish-row .primary { flex: none; margin-left: auto; white-space: nowrap; }
.activity-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 16px; min-width: 0;
}
.activity-toolbar-title {
  color: var(--md-on-surface-variant);
  font-size: var(--md-body-size); line-height: var(--md-body-line);
  font-weight: 500; letter-spacing: .04em;
}

/* 地点行（发布页「📍 附近地点」） */
.place-row {
  display: block; width: 100%;
  min-height: var(--md-touch);
  margin-top: 12px; padding: 12px 16px;
  border: 1px solid var(--md-outline);
  border-radius: var(--md-shape-sm);
  background-color: transparent;
  color: var(--md-on-surface);
  font-size: var(--md-body-size); line-height: var(--md-body-line);
  text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.place-row:active { background-color: var(--md-state-press); }

/* 近况条目的地名：点一下展开完整地址，再点收回 */
.place-toggle {
  display: block; width: 100%;
  padding: 2px 0;
  border: 0; background: none;
  color: var(--md-primary);
  font: inherit;
  text-align: left;
  text-decoration: underline; text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.place-toggle.expanded { color: var(--md-on-surface-variant); text-decoration: none; }

/* —— 查询位置 —— */
.location-row { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.location-row > svg { width: 20px; height: 20px; color: var(--md-primary); margin-top: 2px; }
.location-row > div { min-width: 0; flex: 1; }
.location-row #peer-address {
  margin: 2px 0;
  color: var(--md-on-surface);
  font-size: var(--md-title-size); line-height: var(--md-title-line);
  overflow-wrap: anywhere;
}
.location-row #peer-location { overflow-wrap: anywhere; }
.location-row .text-button { display: block; margin-top: 4px; }
.peer-map {
  display: block; width: 100%; height: auto;
  margin: 12px 0 2px;
  border-radius: var(--md-shape-md);
  background-color: var(--md-surface-container-high);
  opacity: var(--img-opacity);
  outline: var(--img-outline);
  outline-offset: -1px;
}
#query-map { margin-top: 12px; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.query-state {
  margin-top: 12px;
  color: var(--md-primary);
  font-size: var(--md-body-size); line-height: var(--md-body-line); font-weight: 500;
  overflow-wrap: anywhere;
}
.query-result {
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: var(--md-shape-md);
  background-color: var(--md-surface-container-low);
  color: var(--md-on-surface-variant);
  font-size: var(--md-body-size); line-height: var(--md-body-line);
  overflow-wrap: anywhere;
}

