/* =========================================================
   Starvault V4 · 首页瀑布流、作者主页、评论与外观
   ========================================================= */

/* ---- 字体颜色预设（默认跟随主题） ---- */
html[data-text="black"] {
  --ink: #121815;
  --ink-soft: #2b332f;
  --muted: #5b6560;
  --faint: #8a938e;
}

html[data-text="graphite"] {
  --ink: #303737;
  --ink-soft: #474f4f;
  --muted: #6c7474;
  --faint: #969d9d;
}

html[data-text="teal"] {
  --ink: #0e4f4b;
  --ink-soft: #226661;
  --muted: #4c7b76;
  --faint: #7fa29d;
}

html[data-text="green"] {
  --ink: #174c35;
  --ink-soft: #2b6249;
  --muted: #507c67;
  --faint: #80a08f;
}

html[data-text="mint"] {
  --ink: #0b584b;
  --ink-soft: #1e6d5f;
  --muted: #497f74;
  --faint: #7ba197;
}

html[data-text="blue"] {
  --ink: #1a3f63;
  --ink-soft: #315579;
  --muted: #5b7391;
  --faint: #8799b0;
}

html[data-text="violet"] {
  --ink: #3d3169;
  --ink-soft: #53478b;
  --muted: #746a9f;
  --faint: #9a93b9;
}

html[data-text="rose"] {
  --ink: #6b2c3b;
  --ink-soft: #834453;
  --muted: #a06e7a;
  --faint: #b9969f;
}

html[data-text="amber"] {
  --ink: #5a3f12;
  --ink-soft: #755627;
  --muted: #9a7b4a;
  --faint: #b9a07a;
}

html[data-text="indigo"] {
  --ink: #232c5c;
  --ink-soft: #38417a;
  --muted: #626a9a;
  --faint: #9096b6;
}

html[data-theme="dark"][data-text="black"] {
  --ink: #f3f5f4;
  --ink-soft: #d8ddda;
  --muted: #aab3ae;
  --faint: #808b85;
}

html[data-theme="dark"][data-text="graphite"] {
  --ink: #e8ebeb;
  --ink-soft: #ced3d3;
  --muted: #a6adad;
  --faint: #7c8585;
}

html[data-theme="dark"][data-text="teal"] {
  --ink: #cbf4ed;
  --ink-soft: #a9ded5;
  --muted: #81b6ad;
  --faint: #5f8e87;
}

html[data-theme="dark"][data-text="green"] {
  --ink: #d4f3e1;
  --ink-soft: #b4dec8;
  --muted: #8cbaa3;
  --faint: #668f7c;
}

html[data-theme="dark"][data-text="mint"] {
  --ink: #cbf8ed;
  --ink-soft: #abe4d6;
  --muted: #82bbad;
  --faint: #5e9285;
}

html[data-theme="dark"][data-text="blue"] {
  --ink: #d5e7f9;
  --ink-soft: #b3cce5;
  --muted: #8ba8c3;
  --faint: #68849d;
}

html[data-theme="dark"][data-text="violet"] {
  --ink: #e5defc;
  --ink-soft: #cac1ef;
  --muted: #a59cd1;
  --faint: #8078a9;
}

html[data-theme="dark"][data-text="rose"] {
  --ink: #fadee4;
  --ink-soft: #eabdc6;
  --muted: #ca98a3;
  --faint: #a0757e;
}

html[data-theme="dark"][data-text="amber"] {
  --ink: #f8e8c9;
  --ink-soft: #e6cfa5;
  --muted: #c2a979;
  --faint: #9a855c;
}

html[data-theme="dark"][data-text="indigo"] {
  --ink: #dee4fc;
  --ink-soft: #c0c9ef;
  --muted: #99a3d1;
  --faint: #737da9;
}

/* ---- 头部：右对齐工具区 + 外观弹层 ---- */
.header-top .brand {
  min-width: 0;
  flex: 0 0 auto;
  gap: 9px;
  min-height: 40px;
  padding: 2px;
}

.header-top .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(12, 42, 32, .2);
}

.header-top .brand-copy strong {
  font-size: 15px;
}

.header-top .brand-copy small {
  font-size: 8px;
}

.primary-nav {
  flex: 0 1 auto;
  margin-left: 8px;
}

.primary-nav .nav-item {
  min-height: 38px;
  padding: 0 15px;
  font-size: 12.5px;
  font-weight: 650;
}

.primary-nav .nav-item > [data-icon] {
  display: none;
}

.header-tools {
  margin-left: auto;
  gap: 6px;
}

.header-tool {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.header-tool svg {
  width: 17px;
  height: 17px;
}

.user-chip {
  min-height: 38px;
  padding: 3px 9px 3px 3px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.user-copy strong {
  font-size: 12px;
}

.user-copy small {
  font-size: 9.5px;
}

.appearance-wrap {
  position: relative;
}

.appearance-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 130;
  width: min(356px, calc(100vw - 24px));
  max-height: min(640px, calc(100vh - 96px));
  overflow: auto;
  padding: 15px;
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  background: var(--glass-strong);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  animation: pop-in .16s ease;
}

.appearance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--border);
}

.appearance-head strong,
.appearance-head small {
  display: block;
}

.appearance-head strong {
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -.025em;
}

.appearance-head small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.appearance-close {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.appearance-close svg {
  width: 14px;
  height: 14px;
}

.appearance-section {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.appearance-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
}

.appearance-label small {
  color: var(--faint);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
}

.appearance-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.appearance-options button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 37px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  text-align: left;
}

.appearance-options button:hover {
  background: var(--surface);
}

.appearance-options button.is-active {
  border-color: color-mix(in srgb, var(--primary) 24%, transparent);
  background: var(--primary-soft);
  color: var(--primary-deep);
}

.appearance-options .theme-swatch {
  width: 17px;
  height: 17px;
}

.text-swatch {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-muted);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.text-swatch.is-auto { color: var(--ink); font-size: 8px; }
.text-swatch.is-black { color: #121815; background: color-mix(in srgb, #121815 10%, var(--surface-solid)); }
.text-swatch.is-graphite { color: #303737; background: color-mix(in srgb, #303737 10%, var(--surface-solid)); }
.text-swatch.is-teal { color: #0e4f4b; background: color-mix(in srgb, #0e4f4b 10%, var(--surface-solid)); }
.text-swatch.is-green { color: #174c35; background: color-mix(in srgb, #174c35 10%, var(--surface-solid)); }
.text-swatch.is-mint { color: #0b584b; background: color-mix(in srgb, #0b584b 10%, var(--surface-solid)); }
.text-swatch.is-blue { color: #1a3f63; background: color-mix(in srgb, #1a3f63 10%, var(--surface-solid)); }
.text-swatch.is-violet { color: #3d3169; background: color-mix(in srgb, #3d3169 10%, var(--surface-solid)); }
.text-swatch.is-rose { color: #6b2c3b; background: color-mix(in srgb, #6b2c3b 10%, var(--surface-solid)); }
.text-swatch.is-amber { color: #5a3f12; background: color-mix(in srgb, #5a3f12 10%, var(--surface-solid)); }
.text-swatch.is-indigo { color: #232c5c; background: color-mix(in srgb, #232c5c 10%, var(--surface-solid)); }

.notification-button {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid var(--surface-solid);
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--danger) 35%, transparent);
}

.notification-button.has-unread svg {
  color: var(--primary-deep);
}

/* ---- 页面比例 ---- */
.page-head {
  padding: 6px 4px 14px;
}

.page-head h1 {
  font-size: clamp(25px, 2.8vw, 36px);
  letter-spacing: -.055em;
}

.page-kicker {
  margin-bottom: 3px;
}

.workspace {
  padding-top: 2px;
}

/* ---- 首页信息条 + 瀑布流 ---- */
.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 9px 12px 9px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  background: var(--glass-bg);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.feed-intro {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.feed-intro p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-intro #publicCountLabel {
  color: var(--ink-soft);
}

.feed-live-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
}

.feed-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.feed-controls .search-field {
  min-width: 250px;
}

.feed-controls .search-field input {
  min-height: 36px;
  padding-left: 35px;
  border-radius: 11px;
  font-size: 11.5px;
}

.feed-controls .search-field svg {
  left: 12px;
  width: 14px;
  height: 14px;
}

.feed-controls .icon-button {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.masonry-feed {
  column-count: 4;
  column-gap: 14px;
}

.masonry-feed .empty-state,
.masonry-feed .loading-state {
  column-span: all;
}

.feed-card {
  break-inside: avoid;
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  background: var(--glass-strong);
  box-shadow: var(--card-shadow);
  cursor: zoom-in;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.feed-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--primary) 26%, var(--glass-border));
  box-shadow: var(--shadow-float);
}

.feed-image {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, var(--surface-muted), color-mix(in srgb, var(--primary-soft) 55%, var(--surface-muted)));
}

.feed-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}

.feed-card:hover .feed-image img {
  transform: scale(1.035);
}

.feed-open-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(7, 14, 11, .58);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .02em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.feed-card:hover .feed-open-hint {
  opacity: 1;
  transform: translateY(0);
}

.feed-body {
  padding: 10px 12px 11px;
}

.feed-title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -.015em;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.feed-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.feed-author {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  text-align: left;
}

.feed-author:hover {
  color: var(--primary-deep);
}

.feed-author > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 13ch;
}

.feed-comments {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 10px;
}

.feed-comments svg {
  width: 12px;
  height: 12px;
}

/* ---- 共用头像 ---- */
.feed-avatar,
.guestbook-avatar,
.comment-avatar,
.public-author-avatar,
.notification-avatar,
.author-avatar,
.selection-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-weight: 750;
}

.feed-avatar {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  font-size: 8.5px;
}

.guestbook-avatar {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  font-size: 11px;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 10px;
}

.notification-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 12px;
}

.author-avatar {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: var(--primary-contrast);
  font-size: 28px;
  box-shadow: 0 14px 32px color-mix(in srgb, var(--primary) 26%, transparent);
}

.feed-avatar img,
.guestbook-avatar img,
.comment-avatar img,
.public-author-avatar img,
.notification-avatar img,
.author-avatar img,
.selection-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- 作者主页 ---- */
.author-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid var(--glass-border);
  border-radius: 26px;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(26px) saturate(148%);
  -webkit-backdrop-filter: blur(26px) saturate(148%);
}

.author-hero .loading-state,
.author-hero .empty-state {
  width: 100%;
}

.author-hero-main {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.author-identity {
  min-width: 0;
}

.author-identity h2 {
  margin: 0;
  font-size: clamp(23px, 3vw, 32px);
  font-weight: 750;
  letter-spacing: -.05em;
  line-height: 1.1;
}

.author-handle {
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: .03em;
}

.author-signature {
  max-width: 62ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.author-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.author-works-panel {
  min-width: 0;
}

.guestbook-panel {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  background: var(--glass-strong);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.guestbook-panel .section-heading {
  margin-top: 0;
}

.guestbook-panel .section-heading h2 {
  font-size: 16px;
}

.guestbook-form {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.guestbook-form textarea {
  min-height: 82px;
  resize: vertical;
  font-size: 12px;
}

.guestbook-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.guestbook-form-foot small {
  color: var(--faint);
  font-size: 9px;
  line-height: 1.4;
}

.guestbook-form-foot .button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 11px;
}

.guestbook-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
}

.guestbook-gate p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
}

.guestbook-gate .button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 10px;
}

.guestbook-list {
  display: grid;
  gap: 9px;
}

.guestbook-item {
  display: flex;
  gap: 9px;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface);
}

.guestbook-avatar-button,
.comment-avatar-button {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
}

.guestbook-copy {
  min-width: 0;
  flex: 1;
}

.guestbook-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.guestbook-head button {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  text-align: left;
}

.guestbook-head span {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 9px;
}

.guestbook-copy p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.text-button {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 9px;
}

.text-button:hover {
  text-decoration: underline;
}

.guestbook-empty {
  min-height: 120px;
  padding: 16px;
}

/* ---- 公开详情与评论 ---- */
.detail-dialog {
  width: min(1180px, calc(100vw - 28px));
}

.detail-dialog .detail-content {
  grid-template-columns: minmax(0, 1.5fr) minmax(345px, .7fr);
}

.public-detail-panel {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.public-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.public-author-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.public-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 12px;
}

.public-author-chip span:last-child {
  min-width: 0;
}

.public-author-chip strong,
.public-author-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-author-chip strong {
  font-size: 12px;
  font-weight: 680;
}

.public-author-chip small {
  color: var(--faint);
  font-size: 9px;
}

.public-author-enter {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 7px;
  font-size: 10px;
}

.public-author-enter svg {
  width: 12px;
  height: 12px;
  transform: rotate(180deg);
}

.public-detail-title {
  margin: 4px 0 3px;
  font-size: clamp(20px, 2.4vw, 27px);
  font-weight: 740;
  letter-spacing: -.045em;
  line-height: 1.18;
}

.detail-description {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.comment-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.comment-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.comment-heading h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.comment-heading h3 span {
  color: var(--faint);
  font-weight: 500;
}

.comment-heading small {
  color: var(--faint);
  font-size: 9px;
}

.comment-list {
  display: grid;
  gap: 11px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}

.comment-item {
  display: flex;
  gap: 8px;
}

.comment-copy {
  min-width: 0;
  flex: 1;
}

.comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.comment-head button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  text-align: left;
}

.comment-head span {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 9px;
}

.comment-copy p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.comment-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.comment-form textarea {
  flex: 1;
  min-height: 52px;
  resize: vertical;
  font-size: 11.5px;
}

.comment-form .button {
  min-height: 38px;
  padding: 0 13px;
  font-size: 11px;
}

.comment-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 10.5px;
}

.comment-gate .button {
  min-height: 31px;
  padding: 0 11px;
  font-size: 10px;
}

.comment-empty {
  min-height: 96px;
  padding: 14px;
}

.comment-empty strong {
  font-size: 12.5px;
}

.comment-empty span {
  font-size: 10.5px;
}

/* ---- 通知 ---- */
.notification-dialog {
  width: min(580px, calc(100vw - 28px));
}

.notification-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notification-head .button {
  min-height: 33px;
  padding: 0 10px;
  font-size: 10.5px;
}

.notification-list {
  display: grid;
  gap: 5px;
  max-height: 58vh;
  overflow: auto;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
}

.notification-item:hover {
  background: var(--surface);
}

.notification-item.is-unread {
  border-color: color-mix(in srgb, var(--primary) 16%, transparent);
  background: var(--primary-soft);
}

.notification-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.notification-copy > span {
  font-size: 11.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.notification-copy small {
  color: var(--faint);
  font-size: 9px;
}

.notification-kind {
  flex: 0 0 auto;
  color: var(--faint);
}

.notification-kind svg {
  width: 15px;
  height: 15px;
}

/* ---- 设置 / 后台 ---- */
.settings-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
}

.settings-profile {
  grid-row: span 2;
}

.settings-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  color: var(--muted);
}

.settings-tip svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--primary);
}

.settings-tip strong,
.settings-tip small {
  display: block;
}

.settings-tip strong {
  color: var(--ink-soft);
  font-size: 11.5px;
}

.settings-tip small {
  margin-top: 1px;
  font-size: 10px;
  line-height: 1.45;
}

.admin-panel .panel-heading h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -.035em;
}

.admin-divider {
  height: 1px;
  margin: 24px 0;
  background: var(--border);
}

.moderation-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.moderation-form label {
  flex: 1 1 300px;
}

.moderation-form textarea {
  min-height: 96px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
}

.moderation-form .button {
  min-height: 42px;
}

/* ---- 响应式 ---- */
@media (max-width: 1280px) {
  .masonry-feed {
    column-count: 3;
  }
}

@media (max-width: 1080px) {
  .author-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .primary-nav .nav-item {
    padding: 0 11px;
  }
}

@media (max-width: 980px) {
  .site-header {
    position: sticky;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 8px 12px;
    border-radius: 0 0 22px 22px;
    border-left: 0;
    border-right: 0;
    border-top: 0;
  }

  .header-top {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .header-top .brand {
    flex: 0 0 auto;
  }

  .header-top .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .header-top .brand-copy strong {
    font-size: 14px;
  }

  .header-top .brand-copy small {
    display: none;
  }

  .primary-nav {
    display: none;
  }

  .header-tools {
    gap: 5px;
  }

  .header-tools [data-view="upload"],
  .header-tools [data-view="settings"] {
    display: none !important;
  }

  .header-tool {
    width: 35px;
    height: 35px;
    border-radius: 11px;
  }

  .user-chip {
    gap: 6px;
    min-height: 35px;
    padding: 2px 7px 2px 2px;
  }

  .user-avatar {
    width: 29px;
    height: 29px;
  }

  .user-copy strong {
    max-width: 72px;
    font-size: 11px;
  }

  .user-copy small,
  .user-caret {
    display: none;
  }

  .appearance-popover {
    position: fixed;
    top: 66px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 150px);
  }

  .author-layout {
    grid-template-columns: 1fr;
  }

  .guestbook-panel {
    position: static;
    max-height: none;
  }

  .author-hero {
    padding: 18px;
  }

  .author-avatar {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    font-size: 23px;
  }

  .feed-toolbar {
    padding: 9px 10px;
  }

  .feed-controls {
    flex: 1 1 100%;
  }

  .feed-controls .search-field {
    flex: 1;
    min-width: 0;
  }

  .feed-intro {
    flex: 1 1 100%;
  }

  .detail-dialog .detail-content {
    grid-template-columns: 1fr;
  }

  .detail-dialog {
    max-height: 94vh;
  }

  .public-detail-panel {
    padding: 18px;
  }

  .comment-list {
    max-height: 280px;
  }
}

@media (max-width: 760px) {
  .masonry-feed {
    column-count: 2;
    column-gap: 10px;
  }

  .feed-card {
    margin-bottom: 10px;
    border-radius: 14px;
  }

  .feed-body {
    padding: 8px 9px 9px;
  }

  .feed-title {
    font-size: 11.5px;
  }

  .feed-foot {
    margin-top: 6px;
  }

  .feed-open-hint {
    display: none;
  }

  .page-head {
    padding: 8px 2px 12px;
  }

  .page-head h1 {
    font-size: 26px;
  }

  .author-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-radius: 20px;
  }

  .author-hero-main {
    gap: 13px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .notification-dialog {
    padding: 20px 15px;
  }

  .moderation-form {
    display: grid;
  }

  .moderation-form .button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .header-top {
    gap: 6px;
  }

  .brand-copy {
    display: none;
  }

  .header-top .brand {
    gap: 0;
  }

  .user-copy strong {
    max-width: 58px;
  }

  .masonry-feed {
    column-gap: 8px;
  }

  .feed-card {
    margin-bottom: 8px;
  }

  .feed-title {
    font-size: 11px;
  }
}


/* ---- 视觉修正：弹层可读性、关闭按钮避让、移动端信息密度 ---- */
.appearance-popover {
  background:
    radial-gradient(120% 70% at 100% 0%, var(--primary-soft), transparent 58%),
    var(--surface-solid);
}

.public-detail-panel .public-author-row {
  padding-right: 44px;
}

.notification-head {
  padding-right: 44px;
}

.author-works-panel .feed-author {
  display: none;
}

.author-works-panel .feed-foot {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  body[data-active-view="public"] .page-head,
  body[data-active-view="author"] .page-head {
    display: none;
  }
}

@media (max-width: 480px) {
  .brand-copy {
    display: grid;
  }

  .header-top .brand-copy strong {
    font-size: 13px;
  }

  .user-copy strong {
    max-width: 52px;
  }
}

@media (max-width: 360px) {
  .brand-copy {
    display: none;
  }
}

.auth-actions {
  margin-top: 22px;
}

.auth-actions .button {
  min-height: 38px;
  font-size: 12px;
}

/* ---- 设置页公开主页卡片 ---- */
.settings-home-card {
  grid-column: 2;
  grid-row: auto;
}

.settings-home-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.settings-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: var(--primary-contrast);
  font-size: 21px;
  font-weight: 750;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 22%, transparent);
}

.settings-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-home-preview > div {
  min-width: 0;
}

.settings-home-preview strong,
.settings-home-preview small {
  display: block;
}

.settings-home-preview strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-home-preview small {
  margin-top: 1px;
  color: var(--faint);
  font-size: 10px;
}

.settings-home-preview p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .settings-profile {
    grid-row: auto;
  }

  .settings-home-card {
    grid-column: auto;
    grid-row: auto;
  }
}
