/*
 * koi-share-sheet.css — 画作详情页全新共用分享面板（对齐 App koi_share_sheet）
 * 自包含 .kss-* 命名；单一强调色 var(--b2color)（仅「转发」磁贴 + focus 环）；
 * 一套圆角/间距标尺；移动贴底上拉 sheet、桌面居中卡；无 emoji（图标走 B2 字体字形）。
 * 转发编辑器复用 koi-space-compose 的 .ksp-* 模态（koi-space-r6.css 提供），本文件不重复其样式。
 */

.kss-mask {
  position: fixed;
  inset: 0;
  z-index: 100020;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(17, 19, 22, .5);
  opacity: 0;
  transition: opacity .24s ease;
  -webkit-tap-highlight-color: transparent;
}
.kss-mask.kss-in { opacity: 1; }

.kss-sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .18);
  padding: 6px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32, .72, 0, 1);
  will-change: transform;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.kss-mask.kss-in .kss-sheet { transform: translateY(0); }

/* 桌面：居中浮层卡 */
@media (min-width: 768px) {
  .kss-mask { align-items: center; }
  .kss-sheet {
    max-width: 440px;
    border-radius: 20px;
    padding: 8px 22px 22px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .24);
    transform: translateY(18px) scale(.98);
    max-height: 86vh;
  }
  .kss-mask.kss-in .kss-sheet { transform: translateY(0) scale(1); }
  .kss-grabber { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .kss-mask, .kss-sheet { transition: opacity .18s ease; }
  .kss-sheet { transform: none; }
  .kss-mask.kss-in .kss-sheet { transform: none; }
}

.kss-grabber {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  background: #d9dde2;
  margin: 8px auto 4px;
}

/* 头部 */
.kss-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 12px;
}
.kss-title { font-size: 15px; font-weight: 600; color: #1b1e21; letter-spacing: .01em; }
.kss-x {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; padding: 0; margin: 0;
  background: transparent; color: #9096a0; cursor: pointer;
  border-radius: 50%; font-size: 18px; line-height: 1;
  -webkit-appearance: none; appearance: none;
  transition: background .15s, color .15s;
}
.kss-x:hover { background: #f2f3f5; color: #303539; }
.kss-x .b2font { font-size: 18px; }

/* 画作预览条 */
.kss-preview {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: #f6f7f9;
  border-radius: 14px;
  margin-bottom: 14px;
}
.kss-preview-thumb {
  width: 48px; height: 48px; flex: 0 0 48px;
  border-radius: 12px; object-fit: cover;
  background: #e9ebef;
}
.kss-preview-meta { min-width: 0; flex: 1; }
.kss-preview-title {
  font-size: 14px; font-weight: 600; color: #23262a;
  line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kss-preview-author {
  font-size: 12px; color: #8a9099; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 最近私信联系人行 */
.kss-dm-wrap { margin-bottom: 6px; }
.kss-dm-label { font-size: 12px; color: #9096a0; margin: 2px 2px 8px; }
.kss-dm {
  display: flex; gap: 14px;
  overflow-x: auto; overflow-y: hidden;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}
.kss-dm::-webkit-scrollbar { display: none; }
.kss-dm-item {
  flex: 0 0 auto;
  width: 56px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; background: none; border: 0; padding: 0;
  -webkit-appearance: none; appearance: none;
  transition: transform .12s ease;
}
.kss-dm-item:active { transform: scale(.94); }
.kss-dm-av {
  width: 50px; height: 50px; border-radius: 50%;
  object-fit: cover; background: #e9ebef;
  border: 1px solid rgba(0, 0, 0, .04);
}
.kss-dm-more .kss-dm-av {
  display: flex; align-items: center; justify-content: center;
  color: #7b828b; background: #f0f2f4;
}
.kss-dm-more .kss-dm-av .b2font { font-size: 22px; }
.kss-dm-name {
  font-size: 11px; color: #6b7178; max-width: 56px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
}
/* 私信行骨架 */
.kss-dm-skel .kss-dm-av { background: linear-gradient(90deg, #eef0f2 25%, #e5e8eb 50%, #eef0f2 75%); background-size: 200% 100%; animation: kss-shimmer 1.2s linear infinite; }
.kss-dm-skel .kss-dm-name { width: 40px; height: 9px; border-radius: 4px; background: #eef0f2; }
@keyframes kss-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .kss-dm-skel .kss-dm-av { animation: none; } }

.kss-divider { height: 1px; background: #eef0f2; margin: 6px -20px 14px; }
@media (min-width: 768px) { .kss-divider { margin: 6px -22px 14px; } }

/* 动作网格 */
.kss-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 4px;
  padding: 2px 0 4px;
}
.kss-act {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; -webkit-appearance: none; appearance: none;
  color: #4a4f55;
}
.kss-act-ic {
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #f2f3f5; color: #3b4046;
  transition: transform .12s ease, background .15s ease;
}
.kss-act-ic .b2font { font-size: 22px; line-height: 1; }
.kss-act:hover .kss-act-ic { background: #e9ebee; }
.kss-act:active .kss-act-ic { transform: scale(.9); }
.kss-act-label { font-size: 12px; color: #5a6068; text-align: center; line-height: 1.2; }
/* 主动作：转发到动态（唯一强调色） */
.kss-act-primary .kss-act-ic { background: var(--b2color, #ff5c8d); color: #fff; }
.kss-act-primary:hover .kss-act-ic { filter: brightness(.96); }
.kss-act:focus-visible { outline: none; }
.kss-act:focus-visible .kss-act-ic { box-shadow: 0 0 0 3px rgba(0, 0, 0, .06), 0 0 0 5px var(--b2color, #ff5c8d); }

/* ---- 二级弹窗（收藏夹 / 举报）：复用 .kss-mask 遮罩，卡片用 .kss-dialog ---- */
.kss-dialog {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .24);
  padding: 4px 20px 20px;
  transform: translateY(16px);
  transition: transform .24s cubic-bezier(.32, .72, 0, 1);
  max-height: 82vh; overflow-y: auto;
}
.kss-mask.kss-in .kss-dialog { transform: translateY(0); }
@media (max-width: 767px) {
  .kss-dialog { border-radius: 18px 18px 0 0; max-width: 560px; transform: translateY(100%); }
}
@media (prefers-reduced-motion: reduce) { .kss-dialog { transform: none; } }

/* 收藏夹多选 */
.kss-folder-list { margin: 6px 0 2px; }
.kss-folder-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 8px; border-radius: 12px;
  cursor: pointer; transition: background .12s ease;
}
.kss-folder-item:hover { background: #f6f7f9; }
.kss-folder-cover {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px;
  object-fit: cover; background: #eceff2;
}
.kss-folder-info { flex: 1; min-width: 0; }
.kss-folder-name { font-size: 14px; color: #23262a; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kss-folder-count { font-size: 12px; color: #9096a0; margin-top: 1px; }
.kss-folder-check {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  border: 1.5px solid #d3d8de; color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
.kss-folder-check .b2font { font-size: 14px; opacity: 0; }
.kss-folder-item.kss-on .kss-folder-check { background: var(--b2color, #ff5c8d); border-color: var(--b2color, #ff5c8d); }
.kss-folder-item.kss-on .kss-folder-check .b2font { opacity: 1; }

/* 举报弹窗（类型由 B2 后台 report_types 控制） */
.kss-report-label { font-size: 13px; font-weight: 600; color: #33383d; margin: 15px 0 8px; display: flex; align-items: center; gap: 6px; }
.kss-report-label:first-of-type { margin-top: 4px; }
.kss-report-label i { color: #ff453a; font-style: normal; }
.kss-report-opt { font-size: 12px; font-weight: 400; color: #9096a0; }
.kss-report-reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.kss-report-reason {
  display: inline-flex; align-items: center; padding: 8px 15px;
  border: 0; border-radius: 999px; background: #f2f3f5; color: #4a4f55;
  font-size: 13px; cursor: pointer; -webkit-appearance: none; appearance: none;
  transition: background .12s, color .12s;
}
.kss-report-reason:hover { background: #e9ebee; }
.kss-report-reason.kss-on { background: var(--b2color, #ff5c8d); color: #fff; }
.kss-report-ta {
  width: 100%; box-sizing: border-box; min-height: 84px;
  border: 1px solid #e6e9ec; border-radius: 12px; padding: 11px 12px;
  font-size: 14px; color: #23262a; resize: vertical; line-height: 1.5;
  background: #fff; -webkit-appearance: none; appearance: none;
}
.kss-report-ta:focus { outline: none; border-color: var(--b2color, #ff5c8d); }
.kss-report-email {
  width: 100%; box-sizing: border-box; height: 44px;
  border: 1px solid #e6e9ec; border-radius: 12px; padding: 0 12px;
  font-size: 14px; color: #23262a; background: #fff;
  -webkit-appearance: none; appearance: none;
}
.kss-report-email:focus { outline: none; border-color: var(--b2color, #ff5c8d); }
.kss-report-upload { display: flex; gap: 10px; align-items: center; }
.kss-report-up {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 76px; height: 76px; border: 1.5px dashed #d3d8de; border-radius: 12px;
  color: #9096a0; font-size: 12px; cursor: pointer; transition: border-color .15s, color .15s;
}
.kss-report-up:hover { border-color: var(--b2color, #ff5c8d); color: var(--b2color, #ff5c8d); }
.kss-report-up .b2font { font-size: 20px; }
.kss-report-thumb { position: relative; width: 76px; height: 76px; }
.kss-report-thumb img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; }
.kss-report-rm {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .62); color: #fff;
  font-size: 14px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.kss-report-note { font-size: 12px; color: #9096a0; margin: 15px 0 0; line-height: 1.5; }

/* 通用对话头/脚/按钮 */
.kss-dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 12px; }
.kss-dlg-title { font-size: 15px; font-weight: 600; color: #1b1e21; }
.kss-dlg-foot { display: flex; gap: 10px; margin-top: 16px; }
.kss-btn {
  flex: 1; height: 44px; border: 0; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  transition: filter .15s, background .15s, opacity .15s;
}
.kss-btn-primary { background: var(--b2color, #ff5c8d); color: #fff; }
.kss-btn-primary:hover { filter: brightness(.96); }
.kss-btn-primary:active { transform: translateY(1px); }
.kss-btn-primary[disabled] { opacity: .55; cursor: default; }
.kss-btn-ghost { background: #f2f3f5; color: #4a4f55; }
.kss-btn-ghost:hover { background: #e9ebee; }

.kss-empty { padding: 26px 8px; text-align: center; color: #9096a0; font-size: 13px; }
.kss-loading { padding: 26px 8px; text-align: center; color: #9096a0; font-size: 13px; }

/* ---- 分享海报（全新重构） ---- */
.kss-mask.kss-poster-mask { align-items: center; background: rgba(8, 9, 11, .82); }
.kss-poster-wrap {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  width: auto; max-width: 92vw;
  padding: 8px;
  opacity: 0; transform: translateY(14px);
  transition: opacity .26s ease, transform .26s cubic-bezier(.32, .72, 0, 1);
}
.kss-mask.kss-poster-mask.kss-in .kss-poster-wrap { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .kss-poster-wrap { transform: none; } }
.kss-poster-close {
  position: absolute; top: -6px; right: -6px; z-index: 2;
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  -webkit-appearance: none; appearance: none; transition: background .15s;
}
.kss-poster-close:hover { background: rgba(255, 255, 255, .24); }
.kss-poster-stage { display: flex; align-items: center; justify-content: center; min-height: 120px; }
.kss-poster-tip { color: #c7ccd2; font-size: 13px; padding: 40px 20px; }

.kss-poster-card {
  width: min(340px, 84vw);
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.kss-poster-cover { width: 100%; background: #f2f3f5; display: flex; align-items: center; justify-content: center; max-height: 62vh; overflow: hidden; }
.kss-poster-cover img { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; object-fit: contain; }
.kss-poster-body { padding: 15px 16px 16px; }
.kss-poster-title {
  font-size: 16px; font-weight: 700; color: #1b1e21; line-height: 1.4;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.kss-poster-sub { font-size: 12.5px; color: #8a9099; margin-top: 6px; }
.kss-poster-date { margin-left: 8px; color: #b2b8bf; }
.kss-poster-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid #eef0f2;
}
.kss-poster-foot-l { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kss-poster-logo { height: 20px; width: auto; object-fit: contain; align-self: flex-start; }
.kss-poster-foot-l span { font-size: 12px; color: #7b828b; }
.kss-poster-qr { width: 66px; height: 66px; flex: 0 0 66px; border-radius: 8px; }
.kss-poster-out { width: min(340px, 84vw); border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); display: block; }

.kss-poster-bar { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(340px, 84vw); }
.kss-poster-bar .kss-btn { width: 100%; }
.kss-poster-hint { color: #b7bcc3; font-size: 12.5px; text-align: center; }
