/* ========================================
   Project Share Modal
   ======================================== */

/* Mobile header — hidden on desktop */

.project-share-modal-content {
  max-width: 480px;
  overflow: visible;
  /* Desktop: max-height with stable scrollbar gutter to prevent layout shift */
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.project-share-body {
  padding-top: 12px;
  padding-bottom: 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
/* Desktop scrollbar — match sidebar style */
/* .project-share-body 滚动条走 .duo-scroll 模板（元素已加该 class；移动端隐藏见下方 media query） */

/* 邮件输入框（wrapper 作为统一边框容器） */
.share-email-section {
  padding: 0 0 12px;
}
.share-email-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: calc(8px * var(--corner-k));
  background: transparent;
  padding: 2px 4px 2px 0;
  outline: none;
}
.share-email-wrapper:focus-within {
  border-color: rgba(0,0,0,0.3);
  outline: none;
  box-shadow: none;
}
/* email chips 容器 */
.share-email-chips {
  display: contents;
}
/* 单个 chip */
.share-email-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-bg-card);
  border-radius: 16px;
  corner-shape: round;
  padding: 4px 4px 4px 8px;
  margin-left: 8px;
  font-size: 14px;
  color: var(--color-text);
  line-height: normal;
  max-width: 100%;
  white-space: nowrap;
}
.share-email-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The remove mark inside the 18px chip button keeps its own 8px: it is a mark, not one of the two icon sizes */
.share-email-chip-remove svg { width: 8px; height: 8px; }
.share-email-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  corner-shape: round;
  background: transparent;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 0;
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
html:not([data-input="touch"]) .share-email-chip-remove:hover{
  background: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.7);
}

.share-email-chip-remove:active {
  background: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.7);
}
.share-email-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 8px 8px 8px 16px;
  font-size: 14px;
  color: var(--color-text);
  min-width: 40px;
  line-height: normal;
}
/* 有 chip 时 input 左边距缩小（chip 自带 margin-left） */
.share-email-chips:not(:empty) ~ .share-email-input {
  padding-left: 4px;
}
.share-email-input::placeholder {
  color: var(--color-text-tertiary);
}
/* 覆盖浏览器 autofill 黄色背景（移动端 transparent 无效，必须用实色） */
html:not([data-input="touch"]) .share-email-input:-webkit-autofill,
html:not([data-input="touch"]) .share-email-input:-webkit-autofill:hover,
html:not([data-input="touch"]) .share-email-input:-webkit-autofill:focus{
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #1a1a1a !important;
  background-color: #fff !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* 角色下拉（始终在输入框右侧，不换行） */
.share-role-dropdown {
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 4px;
}
.share-role-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 6px 14px;
  border: none;
  border-radius: calc(6px * var(--corner-k));
  background: transparent;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  transition: background 0.15s;
}
html:not([data-input="touch"]) .share-role-trigger:hover,
html:not([data-input="touch"]) .share-role-trigger:active{ background: var(--color-bg-card); }

.share-role-dropdown.open .share-role-trigger {
  background: var(--color-bg-card);
}
.share-role-trigger:focus,
.share-role-trigger:focus-visible {
  outline: none;
}
/* 角色下拉 chevron 切换 */
.share-role-chevron {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.share-role-chevron svg {
  width: var(--chevron-trigger-size);
  height: var(--chevron-trigger-size);
  opacity: 0.5;
}
.share-role-chevron .chevron-open { display: none; }
.share-role-dropdown.open .share-role-chevron .chevron-closed { display: none; }
.share-role-dropdown.open .share-role-chevron .chevron-open { display: flex; }
.share-role-menu {
  position: fixed;
  min-width: 220px;
  max-width: calc(100vw - 16px);
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: calc(10px * var(--corner-k));
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 99999;
  padding: 4px;
  display: none;
}
.share-role-menu.active {
  display: block;
}
.share-role-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: calc(10px * var(--corner-k) - 4px);   /* concentric with .share-role-menu (10 - 4 pad), same as .share-access-option in this panel */
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
html:not([data-input="touch"]) .share-role-option:hover{
  background: rgba(0,0,0,0.05);
}

.share-role-option:active {
  background: rgba(0,0,0,0.05);
}
.share-role-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-size);
  height: var(--icon-size);
  flex-shrink: 0;
  color: var(--color-text-secondary);
}
.share-role-option-icon svg {
  width: var(--icon-size);
  height: var(--icon-size);
}
.share-role-option.active .share-role-option-icon {
  color: #2563eb;
}
.share-role-option-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}
.share-role-option-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}
.share-role-option-desc {
  font-size: 12px;
  color: rgba(0,0,0,0.45);
}
.share-role-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #2563eb;
  opacity: 0;
  transition: opacity 0.15s;
}
html:not([data-input="touch"]) .share-role-option:hover .share-role-check{
  opacity: 0.3;
}

.share-role-option:active .share-role-check {
  opacity: 0.3;
}
.share-role-option.active .share-role-check {
  opacity: 1;
}
.share-role-option.active .share-role-option-label {
  color: #2563eb;
}

/* 邀请模式底部按钮 */
.share-email-input::placeholder {
  color: var(--color-text-tertiary);
}

/* 访问权限下拉 */
.share-access-section {
  padding: 0 0 12px;
}
.share-access-header {
  margin-bottom: 8px;
}
.share-access-title {
  font-size: 13px;
  font-weight: 500;
  color: rgba(0,0,0,0.45);
}
.share-access-dropdown {
  position: relative;
}
.share-access-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 6px 4px 6px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text);
}
html:not([data-input="touch"]) .share-access-trigger:hover{
  opacity: 0.7;
}

.share-access-trigger:active {
  opacity: 0.7;
}
.share-access-trigger-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.share-access-trigger-icon svg {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}
.share-access-trigger-label {
  flex: 1;
  text-align: left;
  font-weight: 500;
}
/* 访问权限 chevron 切换 */
.share-access-chevron {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.share-access-chevron svg {
  width: var(--chevron-trigger-size);
  height: var(--chevron-trigger-size);
  opacity: 0.5;
}
.share-access-chevron .chevron-open { display: none; }
.share-access-dropdown.open .share-access-chevron .chevron-closed { display: none; }
.share-access-dropdown.open .share-access-chevron .chevron-open { display: flex; }
.share-access-menu {
  position: fixed;
  display: none;
  z-index: 99999;
  min-width: 220px;
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: calc(10px * var(--corner-k));
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 4px;
  white-space: nowrap;
}
.share-access-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: calc(10px * var(--corner-k) - 4px);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text);
  transition: background 0.12s;
}
html:not([data-input="touch"]) .share-access-option:hover{
  background: rgba(0,0,0,0.05);
}

.share-access-option:active {
  background: rgba(0,0,0,0.05);
}
.share-access-option-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.share-access-option-icon svg {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}
.share-access-option-label {
  flex: 1;
  text-align: left;
}
.share-access-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #2563eb;
  display: none;
}
.share-access-option.active .share-access-check {
  display: block;
}
.share-access-option.active {
  color: #2563eb;
}

/* 成员列表 */
.share-members-section {
  padding: 4px 0 8px;
}
.share-member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.share-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  corner-shape: round;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.share-member-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1px;
  min-width: 0;
}
.share-member-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-member-email {
  font-size: 12px;
  color: rgba(0,0,0,0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-member-role {
  font-size: 12px;
  color: rgba(0,0,0,0.5);
  font-weight: 500;
  flex-shrink: 0;
}
.share-member-tag {
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-weight: 400;
}
.share-member-role-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: rgba(0,0,0,0.5);
  padding: 4px 0;
  flex-shrink: 0;
}
html:not([data-input="touch"]) .share-member-role-trigger:hover{
  color: rgba(0,0,0,0.7);
}

.share-member-role-trigger:active {
  color: rgba(0,0,0,0.7);
}
.share-member-role-trigger svg {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

/* 成员角色菜单 — 移除选项（红色） */
.share-role-option-remove .share-role-option-icon {
  color: #ef4444;
}
.share-role-option-remove .share-role-option-label {
  color: #ef4444;
}
html:not([data-input="touch"]) .share-role-option-remove:hover{
  background: rgba(239,68,68,0.06);
}

.share-role-option-remove:active {
  background: rgba(239,68,68,0.06);
}

/* 角色菜单分割线 */
.share-role-divider {
  height: 1px;
  background: rgba(0,0,0,0.08);
  margin: 4px 0;
}

/* 隐私声明 */
.share-privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.03);
  border-radius: calc(8px * var(--corner-k));
}
.share-privacy-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  flex-shrink: 0;
  color: var(--color-text-tertiary);
  margin-top: 1px;
}
.share-privacy-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.share-privacy-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.4;
}
.share-privacy-desc {
  font-size: 12px;
  color: rgba(0,0,0,0.45);
  line-height: 1.4;
}

/* 底部操作区（固定高度，默认/邀请模式切换） */
.share-footer {
  margin-top: auto;
  padding-top: 12px;
}
.share-footer-default {
  display: flex;
  align-items: center;
  gap: 12px;
}
.share-footer-invite {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

/* 社交分享（左侧一排） */
.share-social-section {
  display: flex;
  gap: 8px;
  align-items: center;
}
.share-social-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  corner-shape: round;
  border: 1px solid var(--color-border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #555;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.share-social-btn svg {
  width: var(--icon-size);
  height: var(--icon-size);
}
html:not([data-input="touch"]) .share-social-btn:hover{
  background: rgba(0,0,0,0.05);
  color: var(--color-text);
}

.share-social-btn:active {
  background: rgba(0,0,0,0.05);
  color: var(--color-text);
}

/* 复制链接（右对齐，紧凑按钮） */
.share-copy-btn {
  margin-left: auto;   /* size = the app-wide footer rule (ai-chat-base.css) */
  border-radius: 999px;
  corner-shape: round;
  border: 1px solid var(--color-border);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
html:not([data-input="touch"]) .share-copy-btn:hover{
  background: rgba(0,0,0,0.05);
}

.share-copy-btn:active {
  background: rgba(0,0,0,0.05);
}
.share-copy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.share-copy-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  display: flex;
  align-items: center;
}
.share-copy-icon svg {
  width: var(--icon-size);
  height: var(--icon-size);
}

/* Native share button (mobile only) */
.share-native-btn {
  display: none;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  corner-shape: round;
  border: 1px solid var(--color-border);
  background: transparent;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.share-native-btn:active {
  background: rgba(0,0,0,0.05);
}
.share-native-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  display: flex;
  align-items: center;
}
.share-native-icon svg {
  width: var(--icon-size);
  height: var(--icon-size);
}

@media (pointer: coarse) {
  .share-social-section {
    display: none;
  }
  .share-footer-default {
    justify-content: flex-end;
  }
  .share-copy-btn {
    margin-left: 0;
  }
  .share-native-btn {
    display: flex;
  }
}

/* ── Share Modal Dark Mode ── */
.dark-mode .share-email-wrapper {
  background: transparent;
  border-color: var(--color-border);
}
.dark-mode .share-email-wrapper:focus-within {
  border-color: rgba(255,255,255,0.3);
}
.dark-mode .share-email-chip {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
html:not([data-input="touch"]) .dark-mode .share-email-chip-remove:hover{
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
}

.dark-mode .share-email-chip-remove:active {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
}
.dark-mode .share-email-input {
  color: rgba(255,255,255,0.9);
}
html:not([data-input="touch"]) .dark-mode .share-email-input:-webkit-autofill,
html:not([data-input="touch"]) .dark-mode .share-email-input:-webkit-autofill:hover,
html:not([data-input="touch"]) .dark-mode .share-email-input:-webkit-autofill:focus{
  -webkit-box-shadow: 0 0 0 1000px #212121 inset !important;
  -webkit-text-fill-color: rgba(255,255,255,0.9) !important;
  background-color: #212121 !important;
}
.dark-mode .share-access-title {
  color: rgba(255,255,255,0.4);
}
.dark-mode .share-access-trigger {
  color: rgba(255,255,255,0.9);
}
html:not([data-input="touch"]) .dark-mode .share-access-trigger:hover{
  opacity: 0.7;
}

.dark-mode .share-access-trigger:active {
  opacity: 0.7;
}
.dark-mode .share-access-menu {
  border-color: var(--color-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.dark-mode .share-access-option {
  color: rgba(255,255,255,0.9);
}
html:not([data-input="touch"]) .dark-mode .share-access-option:hover{
  background: rgba(255,255,255,0.08);
}

.dark-mode .share-access-option:active {
  background: rgba(255,255,255,0.08);
}
.dark-mode .share-access-option.active {
  color: #60a5fa;
}
.dark-mode .share-access-check {
  color: #60a5fa;
}
.dark-mode .share-member-avatar {
  background: #444;
}
.dark-mode .share-member-name {
  color: rgba(255,255,255,0.9);
}
.dark-mode .share-member-email {
  color: rgba(255,255,255,0.5);
}
.dark-mode .share-member-role {
  color: rgba(255,255,255,0.5);
}
.dark-mode .share-member-tag {
  color: rgba(255,255,255,0.3);
}
.dark-mode .share-member-role-trigger {
  color: rgba(255,255,255,0.5);
}
html:not([data-input="touch"]) .dark-mode .share-member-role-trigger:hover{
  color: rgba(255,255,255,0.7);
}

.dark-mode .share-member-role-trigger:active {
  color: rgba(255,255,255,0.7);
}
.dark-mode .share-role-option-remove .share-role-option-icon {
  color: #ef4444;
}
.dark-mode .share-role-option-remove .share-role-option-label {
  color: #ef4444;
}
html:not([data-input="touch"]) .dark-mode .share-role-option-remove:hover{
  background: rgba(239,68,68,0.12);
}

.dark-mode .share-role-option-remove:active {
  background: rgba(239,68,68,0.12);
}
.dark-mode .share-role-divider {
  background: rgba(255,255,255,0.08);
}
.dark-mode .share-privacy-notice {
  background: rgba(255,255,255,0.05);
}
.dark-mode .share-privacy-title {
  color: rgba(255,255,255,0.9);
}
.dark-mode .share-privacy-desc {
  color: rgba(255,255,255,0.4);
}
.dark-mode .share-social-btn {
  border-color: var(--color-border);
  color: rgba(255,255,255,0.6);
}
html:not([data-input="touch"]) .dark-mode .share-social-btn:hover{
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

.dark-mode .share-social-btn:active {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}
.dark-mode .share-copy-btn {
  border-color: var(--color-border);
  color: rgba(255,255,255,0.9);
}
html:not([data-input="touch"]) .dark-mode .share-copy-btn:hover{
  background: rgba(255,255,255,0.08);
}

.dark-mode .share-copy-btn:active {
  background: rgba(255,255,255,0.08);
}
.dark-mode .share-native-btn {
  border-color: var(--color-border);
  color: rgba(255,255,255,0.9);
}
.dark-mode .share-native-btn:active {
  background: rgba(255,255,255,0.08);
}

/* WeChat QR code modal */
.wechat-qr-overlay {
  position: fixed;
  inset: 0;
  /* 它挂在 body 上、从分享弹窗里打开,走 float 档才不会开在弹窗背面 */
  z-index: var(--z-float);
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wechat-qr-modal {
  position: relative;
  background: var(--color-bg-panel);
  border-radius: var(--modal-radius);   /* 全站弹窗窗口倒角单一源 */
  padding: 32px 28px 24px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  max-width: 280px;
}
.wechat-qr-modal .project-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
}
.wechat-qr-img {
  border-radius: calc(8px * var(--corner-k));
  display: block;
  margin: 8px auto 0;
}
.wechat-qr-hint {
  margin: 16px 0 20px;
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}
.wechat-qr-copy {
  margin: 0 auto;
}

/* WeChat QR dark mode */
.wechat-qr-modal.dark {
  background: #2a2a2a;
}
.wechat-qr-modal.dark .project-modal-close {
  color: rgba(255,255,255,0.5);
}
html:not([data-input="touch"]) .wechat-qr-modal.dark .project-modal-close:hover{
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
}

.wechat-qr-modal.dark .project-modal-close:active {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
}
.wechat-qr-modal.dark .wechat-qr-img {
  background: #fff;
  padding: 8px;
}
.wechat-qr-modal.dark .wechat-qr-hint {
  color: rgba(255,255,255,0.6);
}
.wechat-qr-modal.dark .share-copy-btn {
  border-color: var(--color-border);
  color: rgba(255,255,255,0.9);
}
html:not([data-input="touch"]) .wechat-qr-modal.dark .share-copy-btn:hover{
  background: rgba(255,255,255,0.08);
}

.wechat-qr-modal.dark .share-copy-btn:active {
  background: rgba(255,255,255,0.08);
}

.dark-mode .share-role-trigger {
  color: rgba(255,255,255,0.9);
}
.dark-mode .share-role-menu {
  border-color: var(--color-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
html:not([data-input="touch"]) .dark-mode .share-role-option:hover{
  background: rgba(255,255,255,0.08);
}

.dark-mode .share-role-option:active {
  background: rgba(255,255,255,0.08);
}
.dark-mode .share-role-option.active .share-role-option-icon {
  color: #60a5fa;
}
.dark-mode .share-role-option-label {
  color: rgba(255,255,255,0.9);
}
.dark-mode .share-role-option-desc {
  color: rgba(255,255,255,0.45);
}
.dark-mode .share-role-option.active .share-role-option-label {
  color: #60a5fa;
}
.dark-mode .share-role-check {
  color: #60a5fa;
}

/* =========================
   Shared Projects Section (Sidebar)
   ========================= */
.shared-projects-section {
  margin-top: 0;
}
.shared-projects-header {
  /* inherits sidebar-section-header: padding 0 12px, height 32px */
}
.shared-projects-icon {
  display: flex;
  align-items: center;
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}
.shared-projects-icon svg {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}
.shared-project-item {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: calc(8px * var(--corner-k));
  cursor: pointer;
  color: var(--sidebar-text-main);
  font-size: 14px;
  transition: background 0.15s;
}
html:not([data-input="touch"]) .shared-project-item:hover{
  background: var(--sidebar-hover);
}

.shared-project-item:active {
  background: var(--sidebar-hover);
}
.shared-project-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shared-project-icon svg {
  width: var(--icon-size);
  height: var(--icon-size);
}
.shared-project-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  corner-shape: round;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.5px;
  font-family: "Flair", "Jost Fallback", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.shared-project-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.shared-project-role {
  font-size: 11px;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

/* Dark mode */
.dark-mode .shared-projects-header {
  color: rgba(255,255,255,0.35);
}
.dark-mode .shared-project-role {
  color: rgba(255,255,255,0.3);
}
.dark-mode .shared-project-avatar[data-color="default"],
.dark-mode-active .shared-project-avatar[data-color="default"] {
  color: #1a1a1a;
}

/* =========================
   7b. Invite Modal
   ========================= */
.invite-modal-content {
  max-width: 340px;
  width: 90%;
  padding: 24px;
  text-align: center;
  position: relative;
}
.invite-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
}
.invite-modal-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-hover);
  border-radius: calc(12px * var(--corner-k));
}
.invite-modal-icon svg {
  width: var(--icon-size);
  height: var(--icon-size);
  color: rgba(0,0,0,0.7);
}
.invite-modal-desc {
  font-size: 14px;
  color: rgba(0,0,0,0.55);
  margin: 0 0 4px;
  font-family: "Flair", "Jost Fallback", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.invite-modal-project-name {
  font-size: 17px;
  font-weight: 500;
  color: rgba(0,0,0,0.85);
  margin: 0 0 2px;
  font-family: "Flair", "Jost Fallback", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.invite-modal-members {
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin: 0 0 24px;
  font-family: "Flair", "Jost Fallback", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.invite-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.invite-modal-actions .project-modal-btn {
  flex: 1;   /* size = the app-wide footer rule (ai-chat-base.css) */
}
/* Dark mode */
.dark-mode .invite-modal-icon svg,
.dark-mode-active .invite-modal-icon svg {
  color: rgba(255,255,255,0.7);
}
.dark-mode .invite-modal-desc,
.dark-mode-active .invite-modal-desc {
  color: rgba(255,255,255,0.55);
}
.dark-mode .invite-modal-project-name,
.dark-mode-active .invite-modal-project-name {
  color: rgba(255,255,255,0.9);
}

/* =========================
   8. Project Collaborators (Header Area)
   ========================= */
.project-collaborators {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
}

/* Avatar Group */
.project-avatar-group {
  display: flex;
  align-items: center;
  padding: 3px 4px;
  border-radius: 999px;
  corner-shape: round;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: transparent;
}
html:not([data-input="touch"]) .project-avatar-group:hover{
  background: var(--color-bg-card);
}

.project-avatar-group:active {
  background: var(--color-bg-card);
}
.project-avatar-group .project-avatar {
  margin-left: -6px;
}
.project-avatar-group .project-avatar:first-child {
  margin-left: 0;
}

.project-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  corner-shape: round;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  line-height: 1;
  color: #fff;
  background: #1a1a1a;
  border: 2px solid var(--color-bg-panel);
  box-sizing: border-box;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
  padding-top: 1px;
  text-indent: 0.5px;
}
/* ★有图的头像必须数学同心:基准里 padding-top 1px / text-indent 0.5px 是给【文字缩写】做
   光学居中的,图片吃了它就变成 16×15 的非正圆、圆心比容器低 0.5px(owner 2026-08-21 实拍点破)。
   这条写在基准的家里、对一切 .project-avatar 生效 —— 别再到各容器里各修一份。 */
.project-avatar.has-avatar { overflow: hidden; padding: 0; text-indent: 0; }
.project-avatar.has-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; corner-shape: round; display: block; }
.project-avatar-owner {
  background: #1a1a1a;
}
.project-avatar-more {
  background: var(--avatar-bg-lit);
  font-size: 10px;
}

/* Member avatar colors */
.project-avatar:nth-child(2) {
  background: #6b7280;
}
.project-avatar:nth-child(3) {
  background: #6b7280;
}

/* Share Button in Header */
.project-header-share-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  corner-shape: round;
  background: var(--color-bg-card);
  color: rgba(0,0,0,0.7);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
html:not([data-input="touch"]) .project-header-share-btn:hover{
  background: rgba(0,0,0,0.1);
}

.project-header-share-btn:active {
  background: rgba(0,0,0,0.1);
}
.project-header-share-btn svg {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  flex-shrink: 0;
}

/* Desktop: hide share item in three-dot menu (shown via header button instead) */
.chat-menu-item--share-project {
  display: none;
}

/* Mobile: hide share button, show share in three-dot menu, avatars condense to 2 */
@media (max-width: 768px), (max-height: 500px) {
  .project-header-share-btn {
    display: none !important;
  }
  .chat-menu-item--share-project {
    display: flex;
  }
  /* 手机端头像：owner + 1 member + plus（JS maxShow=1 已限制） */
}

/* =========================
   9. Chat List Creator Avatars
   ========================= */
.project-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  corner-shape: round;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #fff;
  background: #1a1a1a;
  flex-shrink: 0;
  user-select: none;
}

/* =========================
   10. Dark Mode — Collaborators & Avatars
   ========================= */
.dark-mode .project-avatar {
  border-color: #212121;
  background: #444;
}
.dark-mode .project-avatar-owner {
  background: #444;
}
.dark-mode .project-header-share-btn {
  color: rgba(255,255,255,0.7);
}
html:not([data-input="touch"]) .dark-mode .project-header-share-btn:hover{
  background: rgba(255,255,255,0.14);
}

.dark-mode .project-header-share-btn:active {
  background: rgba(255,255,255,0.14);
}
.dark-mode .project-chat-avatar {
  background: #444;
}

/* ========================================
   Chat Share Modal — Preview Area
   ======================================== */
.chat-share-modal-content {
  max-width: 480px;
  overflow: visible;
}
.chat-share-body {
  padding-top: 12px;
  padding-bottom: 12px;
  display: flex;
  flex-direction: column;
}

/* 聊天预览区 */
.chat-share-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: rgba(0,0,0,0.03);
  border-radius: calc(10px * var(--corner-k));
  max-height: 300px;
  overflow-y: auto;
}

/* 单条消息预览 */
.chat-share-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.chat-share-msg-role {
  font-size: 11px;
  font-weight: 500;
  color: rgba(0,0,0,0.45);
  text-transform: uppercase;
  flex-shrink: 0;
  min-width: 32px;
  padding-top: 2px;
}
.chat-share-msg-content {
  flex: 1;
  min-width: 0;
}
.chat-share-msg-text {
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.chat-share-msg-img {
  width: 80px;
  height: 80px;
  border-radius: calc(8px * var(--corner-k));
  object-fit: cover;
  margin-top: 4px;
}
/* 消息之间分割线 */
.chat-share-msg + .chat-share-msg {
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}
/* 无消息占位 */
.chat-share-empty {
  font-size: 13px;
  color: var(--color-text-tertiary);
  text-align: center;
  padding: 20px 0;
}

/* ── Chat Share Dark Mode ── */
.dark-mode .chat-share-preview {
  background: rgba(255,255,255,0.05);
}
.dark-mode .chat-share-msg-role {
  color: rgba(255,255,255,0.45);
}
.dark-mode .chat-share-msg-text {
  color: rgba(255,255,255,0.9);
}
.dark-mode .chat-share-msg + .chat-share-msg {
  border-color: var(--color-border);
}

/* =========================================================
   Project Share Modal — Mobile Slide-Up Sheet
   ========================================================= */
@media (max-width: 768px), (max-height: 500px) {
  /* Overlay → align to bottom */
  #projectShareModal,
  .studio-meeting-share-modal {
    align-items: flex-end;
    justify-content: flex-end;
  }

  /* Sheet container:尺寸/圆角/上滑下滑全在 .duo-sheet 真源(ai-chat-sheet.css),JS 开关走 DuoSheet;
     overflow 留 hidden(内部自己滚),别让真源的 overflow-y:auto 接管 */
  #projectShareModal .project-share-modal-content,
  .studio-meeting-share-modal .project-share-modal-content {
    overflow: hidden;
    box-shadow: none;
    padding: 0;
  }

  /* Hide desktop header */
  #projectShareModal .share-desktop-header,
  .studio-meeting-share-modal .share-desktop-header {
    display: none;
  }

  .share-mobile-title {
    font-size: 17px;
    font-weight: 500;
    font-family: "Flair", "Jost Fallback", "PingFang SC", "Microsoft YaHei", sans-serif;
    margin: 0;
    flex: 1;
    text-align: center;
    color: var(--color-text);
  }
  .share-mobile-spacer {
    width: 36px;
    flex-shrink: 0;
  }

  /* Body — scrollable(壳形契约:浮头玻璃压在这个滚动区上,顶距从头高推导;
     滚动条样子归 .duo-scroll 模板,这里零外观规则) */
  #projectShareModal .project-share-body,
  .studio-meeting-share-modal .project-share-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px 16px;
    scrollbar-gutter: auto;
  }

  /* Footer — sticky at bottom */
  #projectShareModal .share-footer {
    flex-shrink: 0;
    padding: 8px 16px 32px;
    border-top: 1px solid var(--color-border);
  }

  /* Dark mode — mobile sheet */
  .dark-mode .share-mobile-title { color: rgba(255,255,255,0.9); }
}

/* ── 把一台电脑接进 DuoHand(studio-bench)──
   壳完全复用分享弹窗(.project-modal / .project-share-body / .share-member-item),
   这里只加它独有的三样:那串要照着敲的码、要照着跑的命令、已连机器的小标题。 */
.studio-bench-intro {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(0,0,0,0.6);
}
.studio-bench-code {
  position: relative;
  padding: 18px 12px;
  border: 1px solid var(--color-border);
  border-radius: calc(14px * var(--corner-k));
  text-align: center;
  font-family: "SF Mono", "Menlo", "Monaco", "Consolas", "PingFang SC", "Microsoft YaHei", monospace;
  font-size: 28px;
  letter-spacing: 2px;
  /* 这串码要被人念出来或抄到另一台机器上,所以它可以被选中 —— 别继承弹窗的 user-select: none */
  user-select: text;
}
/* 复制按钮压在码的右上角(复用 .chat-header-btn 的 36×36/圆角/hover,不自造)。
   ★它是码旁边的一个小动作,不该跟那串 28px 的码抢:按聊天正文那一档(16px)、用次级文字色。 */
.studio-bench-code-copy {
  position: absolute;
  top: 6px;
  right: 6px;
  color: var(--color-text-secondary);
}
.studio-bench-code-copy svg { width: var(--icon-size-sm); height: var(--icon-size-sm); }
/* 复制成功的那一下:图标换成对勾(JS 换,照代码块那颗按钮的基准),这里让它同时【亮起来】——
   平时是次要色,那一瞬是正文色。只靠一抹淡背景,在深色面板上的小图标按钮上几乎看不见。
   用 --color-bg-hover:它自己适配暗色,不需要再写一套 .dark-mode 覆盖 */
.studio-bench-code-copy.is-copied { background: var(--color-bg-hover); color: var(--color-text); }
/* 过期:划掉 + 变淡,配上底下那句"已过期"和"换一个"。光变淡会读成"加载中" */
.studio-bench-code.is-expired .studio-bench-code-text {
  text-decoration: line-through;
  opacity: var(--dim);
}
.studio-bench-step {
  margin: 16px 0 8px;
  font-size: 13px;
  color: rgba(0,0,0,0.6);
}
.studio-bench-command {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: calc(14px * var(--corner-k));
  overflow-x: auto;
}
.studio-bench-command code {
  font-family: "SF Mono", "Menlo", "Monaco", "Consolas", "PingFang SC", "Microsoft YaHei", monospace;
  font-size: 13px;
  white-space: nowrap;
  user-select: text;
}
.studio-bench-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 4px;
}
/* 配对码还剩多久、安装包是哪一版多大 —— 同一种东西:给旁边那个按钮作注脚的一行小字。
   共用一条规则,别让两处慢慢长成两种灰。 */
.studio-bench-expiry {
  font-size: 12px;
  color: rgba(0,0,0,0.45);
}
/* 安装那一段要和底下的码断得开:它回答的是"那台电脑上还没有它怎么办",不是码的一部分。 */
.studio-bench-install { margin-bottom: 20px; }
.studio-bench-devices { margin-top: 24px; }
.studio-bench-devices-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
}
.studio-bench-none {
  margin: 0;
  font-size: 13px;
  color: rgba(0,0,0,0.45);
}

/* 暗色跟着【元素】走,不绑在配对弹窗那个壳上:这几样(说明句、要照抄的那一行、复制按钮)
   现在也用在"排好了,文件放这儿"那个弹窗里,绑壳的话换个弹窗就变成黑底黑字。 */
.dark-mode .studio-bench-intro,
.dark-mode .studio-bench-step { color: rgba(255,255,255,0.6); }
.dark-mode .studio-bench-expiry,
.dark-mode .studio-bench-none { color: rgba(255,255,255,0.45); }
.dark-mode .studio-bench-code,
.dark-mode .studio-bench-command code,
.dark-mode .studio-bench-devices-title { color: rgba(255,255,255,0.9); }
.dark-mode .studio-bench-code-copy { color: rgba(255,255,255,0.6); }
/* 复制成功那一瞬要【亮】。上面那条按元素给的暗色与状态规则同权重、又在它后面,所以不在这里补一条,
   状态就永远被压回次要色 —— 屏幕上就成了"点了没反应"。 */
.dark-mode .studio-bench-code-copy.is-copied { color: rgba(255,255,255,0.95); }

/* 字体库:缺哪几个必须把名字列出来 —— 只说"缺 5 个"等于让人自己猜是哪五个 */
.studio-font-missing { margin-bottom: 16px; }
.studio-font-missing-names {
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: calc(14px * var(--corner-k));
  font-size: 13px;
  line-height: 1.6;
}
