:root {
  --qaq-text: #262626;
  --qaq-muted: #8e8e93;
  --qaq-icon-size: clamp(56px, 16vw, 68px);
  --qaq-page-padding: clamp(14px, 4vw, 22px);
  --qaq-grid-gap-x: clamp(10px, 3.5vw, 18px);
  --qaq-grid-gap-y: clamp(18px, 4vw, 26px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  overflow: hidden;
  background: #e9e9e9;
  color: var(--qaq-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

button {
  border: 0;
  font: inherit;
}

.qaq-desktop {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 320px;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  background: #fafafa;
}

.qaq-wallpaper {
  position: absolute;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 7%, rgba(0, 0, 0, 0.035), transparent 28%),
    radial-gradient(circle at 88% 89%, rgba(0, 0, 0, 0.045), transparent 34%),
    linear-gradient(150deg, #ffffff 0%, #f8f8f8 46%, #eeeeee 100%);
}

.qaq-wallpaper::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.55;
  background:
    linear-gradient(118deg, transparent 0 44%, rgba(0, 0, 0, 0.018) 45% 47%, transparent 48% 100%),
    linear-gradient(43deg, transparent 0 58%, rgba(0, 0, 0, 0.02) 59% 60%, transparent 61% 100%);
}

.qaq-statusbar {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: space-between;
  min-height: calc(env(safe-area-inset-top, 0px) + 36px);
  padding: env(safe-area-inset-top, 0px) 18px 9px;
  color: #111;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.qaq-statusbar-right {
  display: flex;
  align-items: center;
  gap: 7px;
}

.qaq-statusbar-right i {
  font-size: 12px;
}

.qaq-battery {
  position: relative;
  width: 25px;
  height: 12px;
  padding: 2px;
  border: 1.5px solid #111;
  border-radius: 3px;
}

.qaq-battery::after {
  position: absolute;
  top: 3px;
  right: -4px;
  width: 2px;
  height: 4px;
  border-radius: 0 2px 2px 0;
  content: "";
  background: #111;
}

.qaq-battery-level {
  width: 76%;
  height: 100%;
  border-radius: 1px;
  background: #111;
}

.qaq-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.qaq-search {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  width: calc(100% - 32px);
  height: 39px;
  margin: 3px 16px 14px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.055);
  color: #777;
  font-size: 14px;
  text-align: left;
}

.qaq-search:active {
  background: rgba(0, 0, 0, 0.09);
}

.qaq-search i {
  color: #555;
  font-size: 14px;
}

.qaq-pages {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.qaq-pages::-webkit-scrollbar {
  display: none;
}

.qaq-page {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  padding: 2px var(--qaq-page-padding) 12px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.qaq-grid {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: var(--qaq-grid-gap-y) var(--qaq-grid-gap-x);
  width: 100%;
  min-height: 100%;
}

.qaq-tile {
  position: relative;
  display: flex;
  flex: 0 0 calc((100% - (var(--qaq-grid-gap-x) * 3)) / 4);
  flex-direction: column;
  align-items: center;
  min-width: 0;
  gap: 7px;
  cursor: pointer;
  touch-action: pan-x;
  transition: transform 150ms ease, opacity 150ms ease;
}

.qaq-tile:active:not(.qaq-drag-source) {
  transform: scale(0.93);
}

.qaq-editing .qaq-tile {
  touch-action: none;
}

.qaq-icon {
  display: flex;
  flex: 0 0 var(--qaq-icon-size);
  align-items: center;
  justify-content: center;
  width: var(--qaq-icon-size);
  height: var(--qaq-icon-size);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 17px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(222, 222, 222, 0.92));
  box-shadow:
    0 4px 11px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.qaq-icon i {
  color: #202020;
  font-size: clamp(23px, 6.7vw, 29px);
}

.qaq-tile-label {
  width: 100%;
  overflow: hidden;
  color: #242424;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 文件夹封面：强制外框和内部四个图标均为正方形 */
.qaq-folder-icon {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: var(--qaq-icon-size);
  height: var(--qaq-icon-size);
  aspect-ratio: 1 / 1;
  padding: 8px;
  overflow: hidden;
  background: #d3d3d3;
}

.qaq-folder-icon > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.68);
}

.qaq-folder-icon > span i {
  display: block;
  width: auto;
  height: auto;
  font-size: 13px;
  line-height: 1;
}

.qaq-folder-icon span i {
  font-size: 13px;
}

.qaq-delete {
  position: absolute;
  top: -6px;
  right: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #777;
  color: #fff;
  font-size: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}

.qaq-editing .qaq-delete {
  display: flex;
}

.qaq-wiggle {
  animation: qaq-wiggle 360ms ease-in-out infinite alternate;
}

.qaq-drag-source {
  opacity: 0.18;
}

.qaq-drag-proxy {
  position: fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.11);
  filter: drop-shadow(0 14px 14px rgba(0, 0, 0, 0.26));
}

.qaq-drag-proxy .qaq-delete {
  display: none;
}

.qaq-dots {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 27px;
  padding-bottom: 8px;
}

.qaq-dot {
  width: 5px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.28);
  transition: width 180ms ease, background 180ms ease;
}

.qaq-dot.qaq-active {
  width: 18px;
  background: rgba(0, 0, 0, 0.84);
}

.qaq-dock-wrap {
  flex: 0 0 auto;
  height: calc(env(safe-area-inset-bottom, 0px) + 94px);
  padding: 0 12px env(safe-area-inset-bottom, 0px);
}

.qaq-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 86px;
  padding: 8px 12px 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 0;
  border-radius: 25px 25px 0 0;
  background: rgba(238, 238, 238, 0.78);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.qaq-dock .qaq-tile {
  flex: 0 0 auto;
  width: 64px;
}

.qaq-dock .qaq-icon {
  flex-basis: 60px;
  width: 60px;
  height: 60px;
  border-radius: 16px;
}

.qaq-dock .qaq-tile-label {
  display: none;
}

.qaq-folder-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  background: rgba(255, 255, 255, 0.53);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.qaq-folder-modal.qaq-open {
  visibility: visible;
  opacity: 1;
}

.qaq-folder-window {
  width: min(100%, 365px);
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 24px;
  background: rgba(248, 248, 248, 0.94);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.2);
  transform: scale(0.94);
  transition: transform 210ms cubic-bezier(0.2, 0.85, 0.3, 1.15);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.qaq-folder-modal.qaq-open .qaq-folder-window {
  transform: scale(1);
}

.qaq-folder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.qaq-folder-title {
  color: #222;
  font-size: 17px;
  font-weight: 700;
}

.qaq-folder-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: #e4e4e4;
  color: #333;
}

.qaq-folder-grid {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 20px 12px;
  min-height: 145px;
}

.qaq-folder-grid .qaq-tile {
  flex: 0 0 calc((100% - 36px) / 4);
}

.qaq-folder-grid .qaq-icon {
  flex: 0 0 var(--qaq-icon-size);
  width: var(--qaq-icon-size);
  height: var(--qaq-icon-size);
}

.qaq-editbar {
  position: fixed;
  right: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 105px);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 13px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: #555;
  font-size: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.11);
  transform: translate(50%, 20px);
  visibility: hidden;
  opacity: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.qaq-editbar.qaq-show {
  transform: translate(50%, 0);
  visibility: visible;
  opacity: 1;
}

.qaq-editbar button {
  padding: 0;
  background: transparent;
  color: #111;
  font-size: 13px;
  font-weight: 700;
}

@keyframes qaq-wiggle {
  from {
    transform: rotate(-1.1deg);
  }

  to {
    transform: rotate(1.1deg);
  }
}

@media (min-width: 600px) {
  body {
    display: grid;
    place-items: center;
    padding: 18px;
    background: #e8e8e8;
  }

  .qaq-desktop {
    width: min(430px, 100%);
    height: min(900px, calc(100dvh - 36px));
    border: 8px solid #121212;
    border-radius: 38px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  }
}

@media (max-width: 360px) {
  :root {
    --qaq-icon-size: 56px;
    --qaq-grid-gap-x: 9px;
    --qaq-grid-gap-y: 17px;
  }

  .qaq-dock {
    padding-right: 8px;
    padding-left: 8px;
  }

  .qaq-dock .qaq-tile {
    width: 58px;
  }

  .qaq-dock .qaq-icon {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }
}

/* 固定网格空位 */
.qaq-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(88px, auto);
  align-content: start;
  gap: var(--qaq-grid-gap-y) var(--qaq-grid-gap-x);
  width: 100%;
  min-height: 100%;
}

/* 每一个固定空位 */
.qaq-slot {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  min-height: 88px;
  border-radius: 18px;
  transition:
    background 160ms ease,
    outline 160ms ease,
    transform 160ms ease;
}

/* 可放置位置 */
.qaq-slot.qaq-drop-target {
  background: rgba(0, 0, 0, 0.075);
  outline: 2px dashed rgba(0, 0, 0, 0.25);
  outline-offset: -4px;
}

/* 网格中的 App 不再自己参与 flex 宽度计算 */
.qaq-grid > .qaq-slot > .qaq-tile {
  width: 100%;
  flex: 0 0 100%;
}

/* 文件夹里的 App */
.qaq-folder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(88px, auto);
  align-content: start;
  gap: 20px 12px;
  min-height: 176px;
}

/* 文件夹里的图标固定为正方形 */
.qaq-folder-grid .qaq-slot {
  min-height: 88px;
}

.qaq-folder-grid .qaq-tile {
  width: 100%;
  flex: 0 0 100%;
}

.qaq-folder-grid .qaq-icon,
.qaq-folder-grid .qaq-folder-icon {
  flex: 0 0 var(--qaq-icon-size);
  width: var(--qaq-icon-size);
  height: var(--qaq-icon-size);
  min-width: var(--qaq-icon-size);
  min-height: var(--qaq-icon-size);
  aspect-ratio: 1 / 1;
}

/* 文件夹封面里的四个小图标 */
.qaq-folder-icon {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.qaq-folder-icon > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.68);
}

.qaq-folder-icon > span i {
  display: block;
  width: auto;
  height: auto;
  font-size: 13px;
  line-height: 1;
}

/* 更新弹窗 */
.qaq-update-modal {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.qaq-update-modal.qaq-open {
  visibility: visible;
  opacity: 1;
}

.qaq-update-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.qaq-update-card {
  position: relative;
  width: min(100%, 360px);
  padding: 26px 22px 22px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
  color: #222;
  transform: translateY(12px) scale(0.96);
  transition: transform 220ms cubic-bezier(0.2, 0.85, 0.3, 1.1);
}

.qaq-update-modal.qaq-open .qaq-update-card {
  transform: translateY(0) scale(1);
}

.qaq-update-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  margin: 0 auto 14px;
  border-radius: 17px;
  background: #222;
  color: #fff;
  font-size: 21px;
}

.qaq-update-title {
  margin-bottom: 7px;
  color: #171717;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.qaq-update-version {
  margin-bottom: 17px;
  color: #8c8c8c;
  font-size: 12px;
  text-align: center;
}

.qaq-update-content {
  max-height: 210px;
  overflow-y: auto;
  padding: 14px;
  border-radius: 13px;
  background: #f2f2f2;
  color: #555;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
}

.qaq-update-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 19px;
}

.qaq-update-button {
  min-height: 42px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.qaq-update-later {
  background: #eeeeee;
  color: #333;
}

.qaq-update-ignore {
  background: #e2e2e2;
  color: #444;
}

.qaq-update-confirm {
  grid-column: 1 / -1;
  background: #222;
  color: #fff;
}

.qaq-update-button:active {
  transform: scale(0.97);
}

/* ==================== 文件夹 / Dock / 拖动修复 ==================== */

/* 限制内部层级，避免壁纸落到整个页面背景后面 */
.qaq-desktop {
  isolation: isolate;
}

/* 初始化数据库时禁止操作 */
.qaq-desktop.qaq-loading {
  pointer-events: none;
}

/*
 * 图标上的手势交给拖动逻辑。
 * 左右翻页可在桌面空白处滑动，或者点击分页圆点。
 * 不在长按后临时切换 touch-action，避免移动端取消指针。
 */
.qaq-tile {
  touch-action: none;
}

.qaq-pages {
  touch-action: pan-x;
}

.qaq-desktop.qaq-dragging .qaq-pages {
  overflow-x: hidden;
  scroll-snap-type: none;
}

.qaq-desktop.qaq-dragging,
.qaq-desktop.qaq-dragging * {
  cursor: grabbing !important;
}

/* 拖动代理不能继承原图标的半透明状态 */
.qaq-drag-proxy {
  opacity: 1 !important;
  pointer-events: none !important;
  animation: none !important;
  transition: none !important;
  z-index: 9999;
}

.qaq-drag-proxy .qaq-delete {
  display: none !important;
}

/* Dock 改为四个固定槽位，空位置也可以接收拖放 */
.qaq-dock {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  justify-content: initial;
}

.qaq-dock > .qaq-slot {
  width: 100%;
  min-width: 0;
  min-height: 68px;
  height: 68px;
  align-items: center;
  border-radius: 17px;
}

.qaq-dock > .qaq-slot > .qaq-tile {
  width: 100%;
  min-width: 0;
  flex: 0 0 100%;
}

.qaq-dock .qaq-delete {
  top: -5px;
  right: 0;
}

.qaq-dock .qaq-icon {
  width: min(60px, 100%);
  min-width: 0;
  height: auto;
  flex: 0 0 auto;
  aspect-ratio: 1 / 1;
}

/* 文件夹标题改为输入框 */
input.qaq-folder-title {
  display: block;
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  min-height: 36px;
  margin-right: 12px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  outline: none;
  background: transparent;
  color: #222;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}

input.qaq-folder-title:hover {
  background: rgba(0, 0, 0, 0.035);
}

input.qaq-folder-title:focus {
  border-color: rgba(0, 0, 0, 0.18);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.035);
}

.qaq-folder-close {
  flex-shrink: 0;
}

/* 小屏幕上的文件夹不超出可视区域 */
.qaq-folder-window {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 48px);
  min-height: 0;
}

.qaq-folder-head {
  flex-shrink: 0;
}

.qaq-folder-grid {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 7px 4px 12px;
  overscroll-behavior: contain;
  touch-action: pan-y;

  /* 文件夹内部空间较窄，单独限制图标尺寸 */
  --qaq-icon-size: min(56px, 13vw);
}

.qaq-folder-grid .qaq-icon {
  width: var(--qaq-icon-size);
  height: var(--qaq-icon-size);
  min-width: var(--qaq-icon-size);
  min-height: var(--qaq-icon-size);
  flex-basis: var(--qaq-icon-size);
}

.qaq-folder-grid .qaq-slot {
  min-height: 82px;
}

.qaq-folder-grid .qaq-tile {
  touch-action: none;
}

/* 删除后为空的文件夹也保留完整封面 */
.qaq-folder-icon {
  align-content: stretch;
}

/* 编辑栏位于文件夹遮罩上方，文件夹打开时也能点“完成” */
.qaq-editbar {
  z-index: 150;
  max-width: calc(100% - 24px);
}

.qaq-editbar span,
.qaq-editbar button {
  white-space: nowrap;
}

.qaq-slot.qaq-drop-target {
  background: rgba(0, 0, 0, 0.09);
  outline: 2px dashed rgba(0, 0, 0, 0.38);
  outline-offset: -4px;
}

@media (max-width: 360px) {
  .qaq-dock {
    gap: 6px;
  }

  .qaq-dock .qaq-icon {
    width: min(56px, 100%);
    height: auto;
    flex-basis: auto;
  }
}

/* 四行槽位均分桌面高度，不在底部留下无法放置的区域 */
.qaq-page {
  display: flex;
  min-height: 0;
}

.qaq-grid {
  display: grid;
  flex: 1 1 auto;

  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  grid-auto-rows: auto;

  width: 100%;
  height: 100%;
  min-height: 0;

  /* 间隔放到槽位内部，避免槽位之间存在无法命中的缝隙 */
  gap: 0;
  align-content: stretch;
}

.qaq-grid > .qaq-slot {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;

  padding:
    6px
    calc(var(--qaq-grid-gap-x) / 2)
    0;

  align-items: flex-start;
  justify-content: center;
}

.qaq-grid > .qaq-slot > .qaq-tile {
  width: 100%;
  min-width: 0;
  flex: 0 0 100%;
}

/* 编辑提示栏的背景和文字不再挡住下方槽位 */
.qaq-editbar {
  pointer-events: none;
}

.qaq-editbar button {
  pointer-events: auto;
}

/* 正在拖动时，“完成”按钮也不拦截放置位置 */
.qaq-desktop.qaq-dragging .qaq-editbar button {
  pointer-events: none;
}

/*
 * 读取 IndexedDB 期间隐藏默认布局。
 * 使用 visibility 而不是 display:none，
 * 保留分页宽度，避免初始化时测量结果为 0。
 */
.qaq-desktop.qaq-loading .qaq-main,
.qaq-desktop.qaq-loading .qaq-dock-wrap {
  visibility: hidden;
  pointer-events: none;
}

/* 仅显示简单加载提示，不显示默认图标 */
.qaq-desktop.qaq-loading::after {
  content: "正在加载桌面…";
  position: absolute;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  color: #888;
  font-size: 13px;
  pointer-events: none;
}

/* 桌面：四列五行，共 20 个位置 */
.qaq-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
}

/* ==================== 登录 / 注册面板 ==================== */

.qaq-community-entry {
  width: 100%;
  min-height: 42px;
  margin-bottom: 11px;
  border-radius: 12px;
  background: #dedede;
  color: #333;
  font-size: 13px;
  font-weight: 600;
}

.qaq-community-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 390px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  background: rgba(242, 242, 242, 0.92);
}

.qaq-community-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 13px;
}

.qaq-community-head strong {
  color: #242424;
  font-size: 15px;
}

.qaq-community-head button {
  padding: 5px 7px;
  border-radius: 8px;
  background: transparent;
  color: #666;
  font-size: 12px;
}

.qaq-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 12px;
}

.qaq-auth-tab {
  min-height: 34px;
  border-radius: 9px;
  background: #dedede;
  color: #777;
  font-size: 13px;
}

.qaq-auth-tab.qaq-auth-active {
  background: #292929;
  color: #fff;
}

.qaq-auth-form {
  display: grid;
  gap: 9px;
}

.qaq-auth-form input {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: #222;
  font-size: 13px;
  user-select: text;
  -webkit-user-select: text;
}

.qaq-auth-form button,
.qaq-account-view > button {
  min-height: 40px;
  border-radius: 10px;
  background: #292929;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.qaq-auth-message {
  min-height: 20px;
  margin-top: 10px;
  color: #777;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.qaq-auth-message.qaq-error {
  color: #a33;
}

.qaq-account-view {
  display: grid;
  gap: 10px;
}

.qaq-account-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
}

.qaq-account-card > div:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.qaq-account-card strong {
  overflow: hidden;
  color: #222;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qaq-account-card small {
  overflow: hidden;
  color: #888;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qaq-account-card span {
  color: #666;
  font-size: 11px;
}

.qaq-account-avatar {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #d6d6d6;
  color: #555;
}

.qaq-account-view > button:last-child {
  background: #dedede;
  color: #333;
}

.qaq-account-view button:disabled {
  opacity: 0.55;
}
/* hidden 属性必须优先于面板的 display:flex */
[hidden] {
  display: none !important;
}

/* ==================== 全屏社区页面 ==================== */

.qaq-community-panel {
  position: fixed;
  z-index: 3100;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(
      150deg,
      #ffffff 0%,
      #f8f8f8 48%,
      #eeeeee 100%
    );
  color: var(--qaq-text);
  overflow: hidden;
}

.qaq-community-panel[hidden] {
  display: none !important;
}

.qaq-community-head {
  flex: 0 0 auto;
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding:
    env(safe-area-inset-top, 0px)
    18px
    10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(250, 250, 250, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.qaq-community-head strong {
  color: #222;
  font-size: 16px;
}

.qaq-community-head button {
  min-width: 42px;
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 9px;
  background: transparent;
  color: #555;
  font-size: 12px;
}

.qaq-auth-view,
.qaq-account-view {
  width: min(100% - 36px, 380px);
  margin: 24px auto;
}

.qaq-community-panel .qaq-auth-view,
.qaq-community-panel .qaq-account-view {
  flex: 0 0 auto;
}

.qaq-community-panel .qaq-auth-form input {
  background: rgba(255, 255, 255, 0.86);
}

/* 将来的留言板主体 */
.qaq-board-view {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* 留言列表单独滚动 */
.qaq-board-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 14px 100px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* 社区底部 Dock */
.qaq-community-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  flex: 0 0 auto;
  gap: 4px;
  min-height: calc(68px + env(safe-area-inset-bottom, 0px));
  padding:
    8px 10px
    env(safe-area-inset-bottom, 0px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(238, 238, 238, 0.84);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.qaq-community-dock button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 52px;
  border-radius: 12px;
  background: transparent;
  color: #777;
  font-size: 11px;
}

.qaq-community-dock button i {
  font-size: 18px;
}

.qaq-community-dock button.qaq-active {
  color: #222;
  background: rgba(0, 0, 0, 0.07);
}

.qaq-update-content {
  margin-bottom: 0;
}

.qaq-community-entry {
  display: block;
  width: 100%;
  min-height: 42px;
  margin: 10px 0 0;
  border-radius: 12px;
  background: #dedede;
  color: #333;
  font-size: 13px;
  font-weight: 600;
}

.qaq-update-actions {
  margin-top: 10px;
}

.qaq-community-panel.qaq-logged-out {
  filter: none;
}

.qaq-community-panel.qaq-logged-out .qaq-board-view {
  position: relative;
  filter: blur(7px);
  opacity: 0.58;
  pointer-events: none;
}

.qaq-community-login-cover {
  position: absolute;
  z-index: 20;
  inset: 58px 0 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.qaq-community-login-cover button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  background: #292929;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* 确保社区全屏面板真正铺满整个手机屏幕 */
.qaq-community-panel {
  position: absolute !important;
  inset: 0 !important;
  z-index: 3100;
  display: flex;
  flex-direction: column;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fafafa;
  overflow: hidden;
}

/* 登录/注册表单内部样式优化 */
.qaq-auth-view {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 auto;
  max-width: 320px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

.qaq-auth-heading {
  margin-bottom: 18px;
  color: #111;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

/* 底部灰色小字切换样式 */
.qaq-auth-switch {
  margin-top: 14px;
  color: #8e8e93;
  font-size: 13px;
  text-align: center;
}

.qaq-auth-switch button {
  background: transparent;
  color: #007aff;
  font-weight: 600;
  padding: 0;
  border: none;
  font-size: 13px;
  cursor: pointer;
}

/* ==================== 留言板 ==================== */

.qaq-board-view {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.qaq-board-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 14px 18px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.qaq-board-empty {
  flex: 0 0 auto;
  padding: 14px;
  color: #888;
  font-size: 13px;
  text-align: center;
}

.qaq-board-compose {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(250, 250, 250, 0.9);
}

.qaq-board-compose input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: #222;
  font-size: 13px;
  user-select: text;
  -webkit-user-select: text;
}

.qaq-board-compose button {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #292929;
  color: #fff;
}

.qaq-message-card {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.86);
}

.qaq-message-reply {
  margin-top: 9px;
  margin-left: min(28px, calc(var(--qaq-reply-depth) * 18px));
  border-left: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 0 12px 12px 0;
  background: rgba(244, 244, 244, 0.8);
}

.qaq-message-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.qaq-message-avatar {
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 50%;
  background: #d7d7d7;
  color: #666;
}

.qaq-message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qaq-message-user {
  display: grid;
  gap: 3px;
}

.qaq-message-user strong {
  color: #2b2b2b;
  font-size: 13px;
}

.qaq-message-user time {
  color: #999;
  font-size: 10px;
}

.qaq-message-content {
  margin: 10px 0;
  color: #444;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.qaq-message-deleted {
  color: #aaa;
  font-style: italic;
}

.qaq-message-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.qaq-message-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 8px;
  background: transparent;
  color: #888;
  font-size: 11px;
}

.qaq-message-action i {
  font-size: 13px;
}

.qaq-message-action-active {
  color: #222;
  background: rgba(0, 0, 0, 0.07);
}

.qaq-community-panel .qaq-auth-message {
  flex: 0 0 auto;
}

.qaq-board-view {
  position: relative;
}

.qaq-board-list {
  position: relative;
  display: flex;
  flex-direction: column;
}

.qaq-board-status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #8e8e93;
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}

.qaq-board-empty[hidden] {
  display: none !important;
}

.qaq-community-placeholder {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 0;
  padding: 24px;
  color: #777;
  text-align: center;
}

.qaq-community-placeholder strong {
  color: #333;
  font-size: 16px;
}

.qaq-community-placeholder p {
  color: #999;
  font-size: 13px;
}

.qaq-community-placeholder[hidden] {
  display: none !important;
}

.qaq-toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  z-index: 6000;
  max-width: calc(100% - 48px);
  padding: 10px 15px;
  border-radius: 11px;
  background: rgba(40, 40, 40, 0.92);
  color: #fff;
  font-size: 13px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.qaq-toast-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.qaq-toast[data-qaq-type="error"] {
  background: rgba(130, 45, 45, 0.94);
}

.qaq-community-send {
  min-width: 48px;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 8px;
  background: transparent;
  color: #333;
  font-size: 12px;
  font-weight: 600;
}

.qaq-community-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 32px;
  border-radius: 8px;
  background: transparent;
  color: #555;
}

.qaq-community-refresh.qaq-refreshing i {
  animation: qaq-refresh-rotate 500ms linear;
}

@keyframes qaq-refresh-rotate {
  to {
    transform: rotate(360deg);
  }
}

.qaq-board-list,
.qaq-interaction-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.qaq-board-empty,
.qaq-interaction-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #8e8e93;
  font-size: 13px;
  pointer-events: none;
}

.qaq-board-empty[hidden],
.qaq-interaction-empty[hidden] {
  display: none !important;
}

.qaq-board-view,
.qaq-interaction-view {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.qaq-interaction-view {
  flex-direction: column;
}

.qaq-interaction-list {
  padding: 14px;
}

.qaq-interaction-item {
  margin-bottom: 9px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.86);
  color: #444;
  font-size: 13px;
}

.qaq-chat-entry {
  flex: 0 0 auto;
  margin: 0 14px 14px;
  padding: 13px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
}

.qaq-chat-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qaq-chat-entry-head button {
  color: #666;
  font-size: 12px;
}

.qaq-publish-view {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding: 18px;
}

.qaq-publish-view textarea {
  flex: 1 1 auto;
  width: 100%;
  min-height: 220px;
  resize: none;
  padding: 4px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #222;
  font-family: inherit;
  font-size: 17px;
  line-height: 1.7;
  user-select: text;
  -webkit-user-select: text;
}

.qaq-publish-tools {
  display: flex;
  gap: 9px;
  padding: 14px 0;
}

.qaq-publish-tools button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: #e1e1e1;
  color: #555;
  font-size: 12px;
}

/* 社区：简洁信息流 */
.qaq-community-panel { background: #fff; }
.qaq-community-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  min-height: calc(56px + env(safe-area-inset-top, 0px));
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  background: #fff;
  border-bottom: 1px solid #ededed;
}
.qaq-community-head strong { text-align: center; font-size: 16px; }
.qaq-community-head > button:last-child { justify-self: end; }
.qaq-community-head button i { font-size: 19px; }
.qaq-board-list { display: block; padding: 0; }
.qaq-message-card {
  flex-shrink: 0;
  margin: 0;
  padding: 18px 16px;
  border: 0;
  border-bottom: 1px solid #ededed;
  border-radius: 0;
  background: #fff;
}
.qaq-message-head { gap: 10px; }
.qaq-message-avatar { width: 36px; height: 36px; flex-basis: 36px; background: #f0f0f0; }
.qaq-message-user { min-width: 0; gap: 4px; }
.qaq-message-user strong { font-size: 13px; overflow-wrap: anywhere; }
.qaq-message-user time { color: #909090; font-size: 11px; }
.qaq-message-content { margin: 14px 0 12px; color: #262626; font-size: 14px; line-height: 1.7; }
.qaq-message-actions { gap: 14px; flex-wrap: wrap; }
.qaq-message-action {
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #262626;
}
.qaq-message-action i { font-size: 21px; }
.qaq-message-action span { display: none; }
.qaq-message-action-active { background: transparent; color: #d64258; }
.qaq-message-reply {
  margin: 14px 0 0 8px;
  padding: 6px 0 6px 12px;
  border: 0;
  border-left: 1px solid #dedede;
  border-radius: 0;
  background: transparent;
}
.qaq-message-reply .qaq-message-avatar { width: 28px; height: 28px; flex-basis: 28px; }
.qaq-message-reply .qaq-message-action i { font-size: 17px; }
.qaq-community-dock { gap: 0; background: #fff; border-top: 1px solid #ededed; }
.qaq-community-dock button { border-radius: 0; color: #858585; }
.qaq-community-dock button i { font-size: 23px; }
.qaq-community-dock button.qaq-active { background: transparent; color: #111; }
.qaq-community-dock button span { font-size: 10px; }
.qaq-interaction-item { margin: 0; padding: 18px 0; border: 0; border-bottom: 1px solid #ededed; border-radius: 0; background: #fff; }
.qaq-chat-entry { margin: 0; padding: 18px 16px; border: 0; border-top: 1px solid #ededed; border-radius: 0; background: #fff; }
.qaq-publish-view { background: #fff; }
.qaq-publish-view textarea { min-height: 0; font-size: 16px; }
.qaq-auth-message:empty { display: none; }

/* 互动页：整个内容区域独立滚动 */
.qaq-community-panel .qaq-interaction-view {
  display: block;
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.qaq-interaction-shortcuts {
  padding: 6px 16px;
}

.qaq-interaction-shortcut {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 70px;
  background: transparent;
  color: #262626;
  font-size: 14px;
  text-align: left;
}

.qaq-interaction-shortcut + .qaq-interaction-shortcut {
  border-top: 1px solid #f1f1f1;
}

.qaq-interaction-symbol {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #e8e8e8;
  border-radius: 50%;
}

.qaq-interaction-symbol i {
  font-size: 21px;
}

.qaq-interaction-shortcut > i {
  color: #aaa;
  font-size: 12px;
}

.qaq-interaction-shortcut[aria-expanded="true"] > i {
  transform: rotate(90deg);
}

.qaq-interaction-results {
  padding: 0 16px 14px;
}

.qaq-interaction-results .qaq-interaction-list {
  padding: 0;
  overflow: visible;
}

.qaq-interaction-results .qaq-interaction-empty {
  position: static;
  display: grid;
  place-items: center;
  min-height: 120px;
  margin: 0;
  padding: 16px;
  color: #909090;
  font-size: 13px;
}

.qaq-conversations {
  border-top: 1px solid #e8e8e8;
}

.qaq-conversations-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 8px 16px;
}

.qaq-conversations-head strong {
  font-size: 15px;
}

.qaq-conversations-head button {
  width: 40px;
  height: 40px;
  background: transparent;
  color: #262626;
  font-size: 20px;
}

.qaq-conversation-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 78px;
  padding: 12px 16px;
  background: transparent;
  color: #262626;
  text-align: left;
}

.qaq-conversation-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 50%;
  background: #f0f0f0;
}

.qaq-conversation-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qaq-conversation-info {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.qaq-conversation-info strong,
.qaq-conversation-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qaq-conversation-info strong {
  font-size: 14px;
}

.qaq-conversation-info span,
.qaq-conversation-row time {
  color: #909090;
  font-size: 12px;
}

.qaq-conversation-row time {
  align-self: start;
  padding-top: 3px;
}

.qaq-chat-status {
  padding: 36px 16px;
  color: #909090;
  font-size: 13px;
  text-align: center;
}

/* ==================== 留言详情与评论区 ==================== */

.qaq-board-view {
  position: relative;
}

.qaq-message-detail {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.qaq-message-detail[hidden] {
  display: none !important;
}

.qaq-message-detail-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  flex: 0 0 auto;
  min-height: 52px;
  padding: 0 10px;
  border-bottom: 1px solid #ededed;
}

.qaq-message-detail-head strong {
  color: #222;
  font-size: 15px;
  text-align: center;
}

.qaq-message-detail-head button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: transparent;
  color: #333;
  font-size: 17px;
}

.qaq-message-detail-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 24px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* 评论预览比主留言矮 */
.qaq-message-reply {
  position: relative;
  min-height: 0;
  margin: 6px 12px 0 16px;
  padding: 5px 30px 5px 10px;
  border-left: 1px solid #e1e1e1;
  border-radius: 0;
  background: transparent;
}

.qaq-message-reply .qaq-message-head {
  gap: 7px;
}

.qaq-message-reply .qaq-message-avatar {
  flex-basis: 25px;
  width: 25px;
  height: 25px;
}

.qaq-message-reply .qaq-message-user {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.qaq-message-reply .qaq-message-user strong {
  font-size: 12px;
}

.qaq-message-reply .qaq-message-user time {
  font-size: 10px;
}

.qaq-message-reply .qaq-message-content {
  margin: 4px 0 2px;
  font-size: 12px;
  line-height: 1.45;
}

/* 评论默认不显示点赞、评论、转发、删除按钮 */
.qaq-message-reply > .qaq-message-actions {
  display: none;
}

.qaq-message-replies {
  display: block;
}

.qaq-view-comments {
  display: block;
  margin: 8px 0 0 16px;
  padding: 3px 0;
  background: transparent;
  color: #8a8a8a;
  font-size: 12px;
  text-align: left;
}

.qaq-message-reply .qaq-message-reply {
  margin-left: 12px;
}

/* 评论右侧三个点 */
.qaq-comment-more {
  position: absolute;
  top: 8px;
  right: 0;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  background: transparent;
  color: #999;
  font-size: 14px;
}

.qaq-comment-more:active {
  color: #222;
}

/* 微信朋友圈式小菜单 */
.qaq-comment-action-menu {
  position: absolute;
  top: 34px;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid #e4e4e4;
  border-radius: 9px;
  background: #303030;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.16);
}

.qaq-comment-action-menu button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
}

.qaq-comment-action-menu button + button {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
}

.qaq-comment-action-menu button i {
  font-size: 13px;
}

/* 详情页中的根留言正常显示完整操作 */
.qaq-message-detail-list > .qaq-message-card {
  border-bottom: 1px solid #ededed;
}

.qaq-message-detail-head {
  display: none !important;
}

.qaq-message-detail {
  display: block;
  overflow-y: auto;
}

.qaq-message-detail-list {
  height: 100%;
  overflow-y: auto;
  padding-top: 0;
}

.qaq-repost-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: #8b8b8b;
  font-size: 12px;
}

.qaq-repost-label i {
  font-size: 11px;
}