/* Keep the paper-cut layout flat and readable. */
.page-scene {
  background-image: none;
}

.topbar::before,
.journal-card .tape-top {
  background: var(--pink);
}

.side-record,
.search-result {
  width: 100%;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.side-record {
  border-top: 1px dashed var(--line);
}

.filter-row {
  align-items: center;
}

.tag-filters {
  display: flex;
  flex: 1 1 320px;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-row > #record-count {
  margin-left: 0;
}

.manage-tags {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 3px 8px;
  color: var(--mint-deep);
  background: transparent;
  border: 1px dashed var(--mint);
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.manage-tags:hover {
  color: var(--pink);
  border-color: var(--pink);
}

.manage-tags svg {
  width: 13px;
}

.record-stream {
  display: grid;
  gap: 10px;
}

.learning-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) auto;
  gap: 17px;
  align-items: center;
  width: 100%;
  min-height: 151px;
  padding: 11px;
  color: var(--ink);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.learning-row:hover {
  border-color: var(--pink);
  box-shadow: 0 8px 16px rgb(91 89 112 / .1);
  transform: translateY(-2px);
}

.record-cover {
  align-self: stretch;
  overflow: hidden;
  background: var(--soft);
  border-radius: 5px;
}

.record-cover img {
  width: 100%;
  height: 100%;
  min-height: 127px;
  object-fit: cover;
  filter: saturate(.75);
  transition: transform .25s ease;
}

.learning-row:hover .record-cover img {
  transform: scale(1.04);
}

.record-copy {
  min-width: 0;
  padding: 4px 0;
}

.record-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.record-meta b {
  width: 3px;
  height: 3px;
  background: var(--pink);
  border-radius: 50%;
}

.record-access {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  color: var(--pink);
  background: var(--pink-soft);
  border: 1px solid var(--pink-soft);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.2;
}

.record-access svg {
  width: 10px;
  height: 10px;
}

.record-copy > strong {
  display: block;
  margin: 7px 0 5px;
  font-size: 17px;
  line-height: 1.45;
}

.record-summary {
  display: block;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.record-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.record-tags em {
  padding: 2px 6px;
  color: var(--mint-deep);
  background: var(--soft);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
}

.record-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: end;
  padding-bottom: 4px;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.record-action svg {
  width: 13px;
}

.empty-state {
  margin: 0;
  padding: 25px 15px;
  color: var(--muted);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 7px;
  font-size: 12px;
}

.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}

.full-entry fieldset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.full-entry legend {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.tag-choice {
  position: relative;
  cursor: pointer;
}

.tag-choice input {
  position: absolute;
  opacity: 0;
}

.tag-choice span {
  display: block;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
}

.tag-choice input:checked + span {
  color: var(--ink);
  background: var(--pink-soft);
  border-color: var(--pink);
}

.tag-manager > p:not(.dialog-label) {
  margin: -5px 0 16px;
  color: var(--muted);
  font-size: 11px;
}

.tag-manager-list {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
}

.tag-manager-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 35px;
  padding: 7px 9px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
}

.tag-manager-item small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
}

.tag-manager-item button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--pink);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.tag-manager-item button:hover {
  background: var(--pink-soft);
}

.tag-manager-item svg {
  width: 14px;
}

.tag-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.tag-create-form input {
  min-width: 0;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  font-size: 11px;
}

.tag-create-form input:focus {
  border-color: var(--pink);
}

.tag-create-form button {
  padding: 8px 12px;
  color: #fff;
  background: var(--pink);
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.tag-create-form button:hover {
  background: var(--mint-deep);
}

@media (max-width: 680px) {
  .filter-row > #record-count {
    display: block;
    width: 100%;
    margin-top: 3px;
  }

  .learning-row {
    grid-template-columns: 101px minmax(0, 1fr);
    gap: 11px;
    min-height: 126px;
    padding: 8px;
  }

  .record-cover img {
    min-height: 109px;
  }

  .record-copy > strong {
    margin: 4px 0;
    font-size: 14px;
  }

  .record-summary {
    font-size: 10px;
  }

  .record-tags {
    margin-top: 6px;
  }

  .record-action {
    display: none;
  }
}

/* ---------- 真实数据下的补充状态 ---------- */

/* 没有封面的文章：不留白块，给一个中性的占位图标 */
.record-cover.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--soft);
  border: 1px dashed var(--line);
}

.record-cover.is-empty svg {
  width: 20px;
}

.record-access.is-private {
  color: var(--muted);
  background: var(--soft);
  border-color: var(--line);
}

.empty-state a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  color: var(--pink);
  border-bottom: 1px solid var(--pink);
  font-weight: 700;
}

.empty-state a svg {
  width: 13px;
}

/* 快速新增落成草稿后的去向提示 */
.quick-entry-notice {
  margin: 14px 0 0;
  padding: 10px 13px;
  color: var(--ink);
  background: var(--pink-soft);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.7;
}

.quick-entry-notice a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pink);
  border-bottom: 1px solid var(--pink);
  font-weight: 700;
}

.quick-entry-notice svg {
  width: 13px;
}

/* ---------- 真实成员数据 ---------- */

/* 昵称首字头像：顶栏按钮 / 右侧名片 / 成员列表三处容器共用，
   没有头像时不依赖外链占位图，也不会因为签名地址过期变裂图。 */
.account-avatar .avatar-initial,
.profile-image .avatar-initial,
.member-avatar .avatar-initial {
  display: grid;
  place-items: center;
  color: var(--mint-deep);
  background: var(--soft);
  font-weight: 700;
}

.account-avatar .avatar-initial {
  width: 100%;
  height: 100%;
  font-size: 14px;
}

.profile-image .avatar-initial {
  width: 100%;
  height: 100%;
  font-size: 34px;
}

.member-avatar .avatar-initial {
  width: 35px;
  height: 35px;
  border: 2px solid var(--surface);
  border-radius: 6px;
  font-size: 15px;
}

/* 成员列表里标出「我」 */
.member-item.is-self {
  color: var(--pink);
}

.member-item.is-self strong {
  color: var(--pink);
}

/* ---------- 名片顶部的封面带 ---------- */

/* 与成员空间 hero 用同一张背景图（covers.js 统一取值：上传过用 coverUrl，否则按 userId 取默认图） */
.profile-card {
  padding: 0;
  overflow: hidden;
}

.profile-cover {
  position: relative;
  height: 108px;
  background: var(--card-cover) center / cover;
}

/* 压一层自上而下的渐变，和下面的白底衔接自然些 */
.profile-cover::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgb(21 42 39 / .18) 0%, rgb(21 42 39 / .42) 100%);
}

/* 小标签放到照片上，白字加深色投影；这样正文区第一行就是头像，不再有空白档 */
.profile-cover .profile-kicker {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 18px;
  justify-content: flex-start;
  margin: 0;
  color: #fff;
  text-shadow: 0 1px 4px rgb(0 0 0 / .45);
}

.profile-body {
  padding: 0 22px 20px;
}

/* 头像上移压住封面带下沿，形成层叠感——名片卡的常见做法，
   同时消掉「封面 → 标签 → 头像」之间的两段空白 */
.profile-body .profile-image {
  position: relative;
  z-index: 2;
  margin: -48px auto 12px;
}

/* 角标压在照片上，改成半透明白圆底才看得清 */
.profile-card .corner-mark {
  z-index: 2;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgb(255 255 255 / .22);
  border: 1px solid rgb(255 255 255 / .5);
  border-radius: 50%;
}

.profile-card .corner-mark svg {
  width: 16px;
}

/* 标签上下留白收一点，卡片整体更紧凑 */
.profile-card .profile-tags {
  margin: 15px 0;
}

.profile-card .profile-line {
  margin: 4px 0 10px;
}

/* ---------- 全局兜底：hidden 属性 ---------- */

/*
 * 给元素设了 display（flex / grid / block）之后，HTML 的 hidden 属性就失效了 ——
 * 作者样式里的 display 会覆盖浏览器默认的 [hidden] { display: none }。
 * 这个坑在 .auth-tabs / .side-actions / .post-tabs / .record-pager 上都踩过，
 * 统一在这里兜一次，新组件不用再各自补。
 */
[hidden] {
  display: none !important;
}

/* 还没被文章用过的标签：弱化显示，但仍可点（点进去有空态提示） */
.filter[data-empty] {
  color: var(--muted);
  border-style: dashed;
}

/* ---------- 搜索入口做成「一眼认得出」的搜索框 ---------- */

/*
 * 原来是一个药丸按钮写着「搜索记录」，太像普通按钮了 —— 用户反馈"找不到搜索"。
 * 改成常见的「假输入框」：左对齐占位文字 + 快捷键提示，形状和真输入框一致。
 */
.search-trigger {
  min-width: 240px;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
}

.search-trigger .search-placeholder {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-trigger:hover .search-placeholder {
  color: var(--pink);
}

/* 快捷键提示，像 GitHub / Linear 那样 */
.search-kbd {
  flex: 0 0 auto;
  padding: 2px 6px;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 9px;
}

.search-trigger:hover .search-kbd {
  color: var(--pink);
  border-color: var(--pink-soft);
}

@media (max-width: 980px) {
  .search-trigger {
    min-width: 0;
  }

  .search-trigger .search-kbd {
    display: none;
  }
}

@media (max-width: 680px) {
  /* 窄屏只留放大镜图标，样式回到原来的方形按钮 */
  .search-trigger .search-placeholder {
    display: none;
  }
}

/* ---------- 搜索弹窗里的「标签匹配」 ---------- */

.search-tag-hits {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.search-tag-hits .search-tag-label {
  margin: 0 2px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.search-tag-hit {
  padding: 4px 10px;
  color: var(--mint-deep);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
}

.search-tag-hit:hover {
  color: #fff;
  background: var(--mint-deep);
  border-color: var(--mint-deep);
}

/* ---------- 标签管理：关注开关 + 仅博主的删除 ---------- */

.tag-manager-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tag-manager-name {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-wrap: anywhere;
}

.tag-manager-name small {
  flex: 0 0 auto;
  padding: 2px 6px;
  color: var(--muted);
  background: var(--soft);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 8px;
}

.tag-manager-tools {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 关注开关：未关注是描边，已关注是实心，一眼能区分 */
.tag-follow {
  min-height: 28px;
  /* 「取消关注」是 4 个字，不给够宽度会折成两行，把行高撑歪 */
  min-width: 68px;
  padding: 0 11px;
  white-space: nowrap;
  color: var(--mint-deep);
  background: var(--surface);
  border: 1px solid var(--mint-deep);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
}

.tag-follow:hover:not(:disabled) {
  color: #fff;
  background: var(--mint-deep);
}

.tag-follow.is-on {
  color: #fff;
  background: var(--mint-deep);
}

.tag-follow.is-on:hover:not(:disabled) {
  color: var(--mint-deep);
  background: var(--surface);
}

.tag-follow:disabled {
  cursor: not-allowed;
  opacity: .55;
}


/* 「移除」是次要操作，别和「关注」抢视觉 */
.tag-follow.is-on {
  color: var(--muted);
  background: var(--surface);
  border-color: var(--line);
}

.tag-follow.is-on:hover:not(:disabled) {
  color: #fff;
  background: var(--pink);
  border-color: var(--pink);
}



/* 删除标签本身（仅博主）：影响所有人，所以用红色描边垃圾桶 */
.tag-delete {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #b23b52;
  background: transparent;
  border: 1px solid #e8bcc6;
  border-radius: 5px;
  cursor: pointer;
}

.tag-delete:hover:not(:disabled) {
  color: #fff;
  background: #c2506e;
  border-color: #c2506e;
}

.tag-delete:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.tag-delete svg {
  width: 14px;
}

/* 「从我的标签里移除」：文字按钮，和 🗑（删除标签本身）区分开 */
.tag-remove-mine {
  min-height: 28px;
  min-width: 52px;
  padding: 0 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-remove-mine:hover:not(:disabled) {
  color: #fff;
  background: #c2506e;
  border-color: #c2506e;
}

.tag-remove-mine:disabled {
  cursor: not-allowed;
  opacity: .55;
}

/* 区块标题右侧放多个操作（「新建项目」+「查看全部」） */
.section-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

/* ---------- 品牌标记里的头像 ---------- */

/*
 * site-brand.js 会往 [data-brand-avatar] 里塞博主的头像；
 * 博主没设头像时塞昵称首字。
 *
 * 各页面标记容器的尺寸由各自的 CSS 决定（.article-brand span 等），
 * 这里只兜底图片本身的填充方式和裁剪。
 * 首页的 .brand-avatar 也是 [data-brand-avatar]，这两条对它无害。
 */
[data-brand-avatar] {
  overflow: hidden;
}

[data-brand-avatar] img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*
 * space.html 头部品牌标记的尺寸。
 *
 * space.css 里只写了 `.space-header .article-brand { display: inline-flex }`，
 * 没给里面的 <span> 定尺寸。以前里面是一个字母 "L."，靠文字撑开所以看不出来；
 * 现在 site-brand.js 往里塞的是博主头像 <img>，图片按自身原始尺寸（120×120）
 * 把容器撑开了。
 *
 * 这里补上尺寸，作用域限定在 .space-header，不影响 article.html 的 .article-brand。
 */
.space-header .article-brand > span {
  width: 25px;
  height: 25px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--mint-deep);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
}
