/*
#	Project: PostOne / 优天帖流 - thread text share + social bar
*/

/* —— 选区浮动工具条 —— */
.po-text-share-toolbar {
  position: absolute;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  background: var(--panel, #fff);
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  overflow: hidden;
}

.po-text-share-toolbar.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.po-text-share-toolbar.is-entering {
  animation: po-text-share-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes po-text-share-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.po-text-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid transparent;
  background: var(--bg-soft, #f1f5f9);
  color: var(--text, #0f172a);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.po-text-share-btn:hover,
.po-text-share-btn:focus-visible {
  background: var(--accent, #2563eb);
  border-color: var(--accent, #2563eb);
  color: #fff;
}

.po-text-share-btn i {
  font-size: 1rem;
}

.po-text-share-btn:hover i,
.po-text-share-btn:focus-visible i {
  color: #fff;
}

mark.po-text-share-mark,
#po-text-share-target {
  background: rgba(37, 99, 235, 0.22);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* —— 帖详情分享栏（方形图标） —— */
.thread-vote-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin: 4px 0 14px;
}

.thread-vote-left {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.thread-vote-actions .thread-read-tools {
  margin-left: auto;
}

.thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.thread-head .thread-meta {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.thread-owner-actions {
  position: relative;
  flex: 0 0 auto;
  margin: 0 0 0 auto;
}
.thread-owner-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid var(--line, #d9e3df);
  border-radius: 8px;
  background: var(--bg, #f4f7f6);
  color: var(--ink, #14201c);
  font-size: 0.8125rem;
  line-height: 1.2;
  cursor: pointer;
}
.thread-owner-toggle .bx { font-size: 1rem; line-height: 1; color: var(--accent, #0f766e); }
.thread-owner-caret { color: var(--muted, #64748b) !important; font-size: 0.95rem !important; transition: transform .15s; }
.thread-owner-actions.is-open .thread-owner-caret { transform: rotate(180deg); }
.thread-owner-toggle:hover {
  border-color: var(--accent, #0f766e);
  background: var(--accent-soft, #e6f3f1);
}
.thread-owner-drop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  width: max-content;
  padding: 4px;
  background: var(--card, #fff);
  border: 1px solid var(--line, #d9e3df);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.thread-owner-drop[hidden] { display: none !important; }
.thread-owner-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink, #14201c);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.thread-owner-item .bx { font-size: 1.05rem; line-height: 1; color: var(--muted, #64748b); }
.thread-owner-item:hover {
  background: var(--accent-soft, #e6f3f1);
  color: var(--accent, #0f766e);
  text-decoration: none;
}
.thread-owner-item:hover .bx { color: var(--accent, #0f766e); }
.thread-owner-item.is-danger { color: #b91c1c; }
.thread-owner-item.is-danger .bx { color: #b91c1c; }
.thread-owner-item.is-danger:hover { background: #fef2f2; color: #b91c1c; }
.thread-owner-item.is-danger:hover .bx { color: #b91c1c; }

.thread-article .panel {
  overflow: visible;
}

.po-share-bar {
  margin: 16px 0 0;
  padding: 28px 0 4px;
  border-top: 1px solid var(--border, #e2e8f0);
  overflow: visible;
}

.po-share-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.po-share-icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  overflow: visible;
}

.po-share-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 5px;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  overflow: visible;
  transition: filter 0.12s ease, box-shadow 0.12s ease;
}

.po-share-icon-btn:hover,
.po-share-icon-btn:focus-visible {
  filter: brightness(1.08);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  outline: none;
  z-index: 2;
}

.po-share-icon-btn::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 3px 7px;
  border-radius: 4px;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 3;
}

.po-share-icon-btn:hover::after,
.po-share-icon-btn:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.po-share-icon-btn i {
  font-size: 1.125rem;
  line-height: 1;
}

.po-share-svg-icon {
  width: 1.125rem;
  height: 1.125rem;
  display: block;
  flex-shrink: 0;
}

.po-share-svg-icon--x {
  width: 1.0625rem;
  height: 1.0625rem;
}

.po-share-svg-icon--wechat {
  width: 1.25rem;
  height: 1.25rem;
}

.po-share-svg-icon--weibo {
  width: 1.3125rem;
  height: 1.3125rem;
}

.po-share-svg-icon--qzone {
  width: 1.25rem;
  height: 1.25rem;
}
.po-share-svg-icon--threads { width: 1.0625rem; height: 1.0625rem; }
.po-share-svg-icon--bluesky { width: 1.125rem; height: 1.125rem; }
.po-share-svg-icon--hackernews { width: 1.125rem; height: 1.125rem; }

.po-share-icon-letter {
  font-size: 0.8875rem;
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.po-share-icon--link {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.po-share-icon--qrcode {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.18);
}

.po-share-icon--email,
.po-share-icon--native {
  background: var(--panel, #fff);
  color: var(--muted, #64748b);
  border: 1.5px solid var(--border, #e2e8f0);
}

.po-share-icon--qrcode .po-share-svg-icon {
  width: 1.1875rem;
  height: 1.1875rem;
}

.po-share-icon--whatsapp { background: #25d366; }
.po-share-icon--telegram { background: #229ed9; }
.po-share-icon--facebook { background: #1877f2; }
.po-share-icon--x { background: #000; color: #fff; }
.po-share-icon--linkedin { background: #0a66c2; }
.po-share-icon--pinterest { background: #e60023; }
.po-share-icon--reddit { background: #ff4500; }
.po-share-icon--threads { background: #000; color: #fff; }
.po-share-icon--bluesky { background: #0085ff; }
.po-share-icon--hackernews { background: #ff6600; color: #fff; border: 1px solid rgba(255, 255, 255, 0.85); }
.po-share-icon--wechat { background: #07c160; }
.po-share-icon--qq { background: #12b7f5; }
.po-share-icon--qzone { background: #face00; color: #12b7f5; }
.po-share-icon--weibo { background: #e6162d; color: #fff; }
.po-share-icon--tieba { background: #2d58ff; }
.po-share-icon--douban { background: #007722; }

.po-share-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.po-share-font-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line, var(--border, #e2e8f0));
  border-radius: 8px;
  padding: 2px;
  background: var(--card, var(--bg-soft, #f8fafc));
}

.po-share-font-btn,
.po-share-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 32px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--ink, var(--text, #0f172a));
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}

.po-share-font-btn:hover,
.po-share-tool-btn:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent, #2563eb);
}

.po-share-font-value {
  min-width: 44px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted, #64748b);
}

.po-share-qr-modal {
  text-align: center;
}

.po-share-qr-hint {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--muted, #64748b);
}

.po-share-qr-wrap {
  display: inline-flex;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
}

.po-share-qr-url {
  margin: 12px 0 0;
  font-size: 0.8rem;
  word-break: break-all;
}

.po-print-header,
.po-print-footer {
  display: none;
}

/* 打印：只保留帖标题与正文排版（隐藏壳层/侧栏/评论/互动） */
@media print {
  .po-nav-progress,
  .strip,
  .site-header,
  .site-footer,
  .site-nav,
  .po-back-to-top,
  .po-modal-root,
  .search-modal,
  .feed-aside,
  .thread-aside,
  .thread-comments-wrap,
  .po-ad-slot,
  .po-share-bar,
  .po-share-tools,
  .po-text-share-toolbar,
  .thread-vote-actions,
  .thread-stat-actions,
  .thread-owner-actions,
  .thread-article .actions,
  .page.thread-article > .feed-layout > .feed-main-col > h2,
  .page.thread-article .comments {
    display: none !important;
  }

  html,
  body.po-page {
    background: #fff !important;
    background-color: #fff !important;
  }
  .page.thread-article,
  .feed-layout,
  .feed-main-col {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .thread-main-article.panel,
  .thread-article .panel {
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    padding: 22px 0 !important;
    margin: 0 !important;
  }
  .thread-main-article h1 {
    margin: 0 0 12px !important;
    color: #000 !important;
  }
  .thread-main-article .body,
  #articleContent {
    color: #111 !important;
  }
  .thread-main-article a {
    color: #000 !important;
    text-decoration: underline;
  }
  .thread-stats .thread-stat:not(.thread-fav):not(.thread-report) {
    color: #333 !important;
  }

  @page {
    margin: 16mm 12mm 18mm;
  }

  .po-print-header,
  .po-print-footer {
    display: block !important;
    position: fixed;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
    font-size: 11px;
    line-height: 1.4;
    color: #333 !important;
    /* 与纸面同色，避免主题底色在固定页眉/页脚上显出灰带 */
    background: #fff !important;
    background-color: #fff !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .po-print-header {
    top: 0;
    padding: 0 0 6px !important;
    border: none !important;
    border-bottom: 0.4pt solid #ccc !important;
    font-weight: 600;
    text-align: center;
  }
  .po-print-footer {
    bottom: 0;
    padding: 6px 0 0 !important;
    border: none !important;
    border-top: 0.4pt solid #ccc !important;
    text-align: center;
    word-break: break-all;
  }
}

@media (max-width: 640px) {
  .po-share-tools,
  .thread-vote-actions .thread-read-tools {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  .thread-owner-actions {
    justify-content: flex-end;
  }
}

/* 后台分享平台勾选 */
.po-share-plat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px 12px;
}

.po-share-plat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--panel, #fff);
  cursor: pointer;
  font-size: 0.9rem;
}

.po-share-plat-item input {
  margin: 0;
}
