/* 工作应用产品演示组件
 * 结构对照 Electron 的 Workspace 侧栏、任务会话、资源标签与 TabDoc 编辑面。
 * 该组件和 Project 共用同一套壳、字体比例、活动栏图标与入场节奏。
 */

.tt-product-demo--shared-resource {
  background: #fff;
}

.tt-product-demo--shared-resource .tt-shell-body {
  grid-template-columns: var(--tt-activity-rail-width) 17.2cqw minmax(0, 1fr);
}

.tt-shared-rail-profile {
  color: #fff;
  background: #dcc646;
  font-size: var(--tt-text-message);
  font-weight: 600;
}

/* ── Workspace 侧栏 ─────────────────────────────────────────── */

.tt-resource-sidebar {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0.72cqw 0.54cqw 0.9cqw;
  border-right: 1px solid var(--tt-line);
  background: #fafafa;
  color: #514d48;
}

.tt-resource-primary-nav {
  display: grid;
  gap: 0.08cqw;
  padding: 0 0.25cqw 0.62cqw;
}

.tt-resource-primary-nav span {
  display: flex;
  align-items: center;
  gap: 0.58cqw;
  height: 1.72cqw;
  padding: 0 0.35cqw;
  border-radius: 0.4cqw;
  font-size: var(--tt-text-message);
  font-weight: 500;
  white-space: nowrap;
}

.tt-resource-primary-nav svg {
  width: 1.05cqw;
  height: 1.05cqw;
  flex: 0 0 auto;
  color: #5d5954;
}

.tt-resource-sidebar__heading {
  display: flex;
  align-items: center;
  height: 2.05cqw;
  padding: 0 0.55cqw;
  color: #5f5a55;
  font-size: var(--tt-text-primary);
  font-weight: 600;
}

.tt-resource-sidebar__heading em {
  color: #aaa59f;
  font-style: normal;
  font-weight: 400;
}

.tt-resource-sidebar__heading-actions {
  display: flex;
  align-items: center;
  gap: 0.25cqw;
  margin-left: auto;
  color: #99948e;
}

.tt-resource-sidebar__heading-actions svg {
  width: 0.78cqw;
  height: 0.78cqw;
}

.tt-resource-workspaces {
  display: grid;
  gap: 0.08cqw;
}

.tt-resource-workspace,
.tt-resource-session {
  min-width: 0;
  overflow: hidden;
  border-radius: 0.45cqw;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tt-resource-workspace {
  display: flex;
  align-items: center;
  gap: 0.52cqw;
  height: 2.05cqw;
  padding: 0 0.5cqw;
  color: #514d48;
  font-size: var(--tt-text-message);
  font-weight: 500;
}

.tt-resource-workspace svg {
  width: 1.02cqw;
  height: 1.02cqw;
  flex: 0 0 auto;
  color: #6c6862;
}

.tt-resource-workspace.is-current {
  background: rgba(221, 122, 32, 0.09);
}

.tt-resource-workspace.is-current svg {
  color: var(--tt-accent);
}

.tt-resource-session {
  position: relative;
  height: 1.75cqw;
  padding: 0.3cqw 0.55cqw 0.3cqw 2.05cqw;
  color: #615c57;
  font-size: var(--tt-text-meta);
}

.tt-resource-session.is-active {
  background: #efeeec;
  color: #35322f;
  font-weight: 500;
}

.tt-resource-session.has-unread::before {
  content: "";
  position: absolute;
  left: 0.82cqw;
  top: 50%;
  width: 0.38cqw;
  height: 0.38cqw;
  border-radius: 50%;
  background: var(--tt-accent);
  transform: translateY(-50%);
}

/* ── 任务与资源双工作面 ─────────────────────────────────────── */

.tt-shared-resource-workspace {
  display: grid;
  grid-template-columns: 54% minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.tt-shared-task-pane,
.tt-shared-doc-pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.tt-shared-task-pane {
  border-right: 1px solid var(--tt-line);
}

.tt-shared-task-header {
  height: 3.45cqw;
  padding: 0 1.55cqw;
}

.tt-shared-member-avatar {
  display: grid;
  place-items: center;
  width: 1.75cqw;
  height: 1.75cqw;
  margin-left: auto;
  border-radius: 50%;
  background: #d5c747;
  color: #fff;
  font-size: var(--tt-text-meta);
  font-weight: 600;
}

.tt-shared-task-header .tt-task-header__collaborator {
  margin-left: 0.42cqw;
}

.tt-shared-task-scroll {
  position: absolute;
  inset: 3.45cqw 0 7.2cqw;
  overflow: hidden;
  padding: 0.9cqw 2cqw 0 1.95cqw;
}

.tt-shared-task-context {
  display: flex;
  align-items: center;
  gap: 0.48cqw;
  margin: 0;
  overflow: hidden;
  color: #a4a09a;
  font-size: var(--tt-text-meta);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tt-shared-task-context svg {
  width: 0.92cqw;
  height: 0.92cqw;
  flex: 0 0 auto;
}

.tt-shared-agent-result {
  margin-top: 0.9cqw;
  color: #3f3b37;
  font-size: var(--tt-text-message);
  line-height: 1.62;
}

.tt-shared-result-copy {
  margin: 0.7cqw 0 0;
}

.tt-shared-agent-result > strong {
  display: block;
  margin-top: 0.72cqw;
  font-weight: 600;
}

.tt-shared-result-list {
  display: grid;
  gap: 0.22cqw;
  margin: 0.35cqw 0 0;
  padding: 0;
  list-style: none;
}

.tt-shared-result-list li {
  position: relative;
  padding-left: 0.85cqw;
}

.tt-shared-result-list li::before {
  content: "•";
  position: absolute;
  left: 0.12cqw;
  color: #aaa59f;
}

.tt-shared-result-list b {
  font-weight: 600;
}

.tt-shared-resource-link {
  display: flex;
  align-items: center;
  gap: 0.48cqw;
  margin-top: 0.48cqw;
  overflow: hidden;
  color: var(--tt-accent);
  font-size: var(--tt-text-meta);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tt-app-mark {
  display: grid;
  place-items: center;
  width: 1.42cqw;
  height: 1.42cqw;
  flex: 0 0 auto;
  border-radius: 0.38cqw;
}

.tt-app-mark svg {
  width: 0.82cqw;
  height: 0.82cqw;
}

.tt-app-mark--doc {
  color: #3478c4;
  background: #eaf3fd;
}

.tt-app-mark--data {
  color: #4c8c75;
  background: #eaf5f0;
}

.tt-app-mark--slide {
  color: #b46d30;
  background: #fff0e1;
}

.tt-shared-output-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.52cqw;
  min-height: 2.72cqw;
  margin-top: 0.42cqw;
  padding: 0.42cqw 0.62cqw;
  border: 1px solid rgba(43, 38, 33, 0.07);
  border-radius: 0.55cqw;
  background: #fbfbfa;
}

.tt-shared-output-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.tt-shared-output-card b,
.tt-shared-output-card small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tt-shared-output-card b {
  color: #47433f;
  font-size: var(--tt-text-meta);
  font-weight: 500;
}

.tt-shared-output-card small {
  color: #aaa59f;
  font-size: var(--tt-text-micro);
}

.tt-shared-output-card__status {
  color: #3c9a6d;
  font-size: var(--tt-text-caption);
}

.tt-shared-composer {
  left: 1.8cqw;
  right: 1.15cqw;
  bottom: 0.62cqw;
  height: 5.95cqw;
}

/* ── 资源标签与 TabDoc ─────────────────────────────────────── */

.tt-shared-tabs {
  height: 3.45cqw;
  padding: 0 0.72cqw;
}

.tt-shared-tabs .tt-workbench-tabs {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.tt-shared-tabs .tt-workbench-tab {
  min-width: 0;
  max-width: 11.4cqw;
  height: 2.15cqw;
  overflow: hidden;
  padding: 0 0.58cqw;
  text-overflow: ellipsis;
}

.tt-shared-tab--workbench {
  flex: 0 0 auto;
}

.tt-shared-tabs .tt-app-mark {
  width: 1.18cqw;
  height: 1.18cqw;
  border-radius: 0.3cqw;
}

.tt-shared-tabs .tt-app-mark svg {
  width: 0.72cqw;
  height: 0.72cqw;
}

.tt-resource-tab.is-active {
  background: #f0eeeb;
}

.tt-resource-tab--slide {
  max-width: 8.8cqw !important;
}

.tt-shared-tabs .tt-workbench-viewmodes {
  flex: 0 0 auto;
}

.tt-shared-doc-toolbar {
  display: flex;
  align-items: center;
  gap: 0.58cqw;
  height: 2.5cqw;
  padding: 0 0.9cqw;
  border-bottom: 1px solid rgba(42, 38, 33, 0.055);
  color: #77736d;
  font-size: var(--tt-text-meta);
}

.tt-shared-sync-state {
  position: relative;
  display: block;
  width: 2.55cqw;
  height: 1.1cqw;
  color: #35a069;
  font-weight: 600;
}

.tt-shared-sync-state__pending,
.tt-shared-sync-state__done {
  position: absolute;
  inset: 0;
  white-space: nowrap;
}

.tt-shared-sync-state__pending {
  opacity: 0;
}

.tt-shared-online-dot {
  width: 0.42cqw;
  height: 0.42cqw;
  border-radius: 50%;
  background: #34a26e;
}

.tt-shared-presence {
  display: flex;
  align-items: center;
  gap: 0.35cqw;
  padding: 0.2cqw 0.4cqw;
  border: 1px solid rgba(46, 41, 36, 0.06);
  border-radius: 0.42cqw;
}

.tt-shared-presence i {
  display: grid;
  place-items: center;
  width: 1.12cqw;
  height: 1.12cqw;
  border-radius: 50%;
  background: #8ccf3e;
  color: white;
  font-size: var(--tt-text-micro);
  font-style: normal;
  font-weight: 600;
}

.tt-shared-word-count {
  color: #8c8781;
}

.tt-shared-doc-actions {
  display: flex;
  align-items: center;
  gap: 0.65cqw;
  margin-left: auto;
  color: #8f8a84;
}

.tt-shared-doc-actions svg {
  width: 0.9cqw;
  height: 0.9cqw;
}

.tt-shared-doc-canvas {
  position: absolute;
  inset: 5.95cqw 0 0;
  overflow: hidden;
  padding: 1.55cqw 2cqw 2.3cqw;
  background: #fff;
  color: #37332f;
}

.tt-shared-doc-title {
  max-width: 92%;
  margin: 0;
  color: #26231f;
  font-size: 1.48cqw;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.tt-shared-doc-source {
  margin-top: 0.95cqw;
  padding: 0.68cqw 0.82cqw;
  border-radius: 0.5cqw;
  background: #f7f6f4;
  color: #79746e;
  font-size: var(--tt-text-meta);
  line-height: 1.65;
}

.tt-shared-doc-source b {
  font-weight: 500;
}

.tt-shared-doc-source span {
  color: var(--tt-accent);
  text-decoration: underline;
  text-underline-offset: 0.14cqw;
}

.tt-shared-doc-section {
  position: relative;
  margin-top: 1.65cqw;
  padding-top: 1.35cqw;
  border-top: 1px solid rgba(42, 38, 33, 0.1);
  font-size: var(--tt-text-message);
  line-height: 1.65;
}

.tt-shared-doc-section h2 {
  margin: 0 0 0.55cqw;
  font-size: 1.22cqw;
  font-weight: 600;
}

.tt-shared-doc-section h3 {
  margin: 0.72cqw 0 0.3cqw;
  font-size: var(--tt-text-message);
  font-weight: 600;
}

.tt-shared-doc-section p {
  margin: 0;
}

.tt-shared-doc-section ul {
  display: grid;
  gap: 0.28cqw;
  margin: 0;
  padding-left: 1.15cqw;
}

.tt-shared-doc-section b {
  font-weight: 600;
}

.tt-shared-collab-caret {
  position: absolute;
  right: 7.3cqw;
  bottom: 0.18cqw;
  width: 0.1cqw;
  height: 1.12cqw;
  background: #7fbd4b;
}

.tt-shared-collab-caret i {
  position: absolute;
  left: 0;
  bottom: 100%;
  padding: 0.08cqw 0.32cqw;
  border-radius: 0.25cqw 0.25cqw 0.25cqw 0;
  background: #7fbd4b;
  color: white;
  font-size: var(--tt-text-micro);
  font-style: normal;
  line-height: 1.35;
  white-space: nowrap;
}

.tt-shared-doc-section table {
  width: 100%;
  margin-top: 0.5cqw;
  border-collapse: collapse;
  font-size: var(--tt-text-meta);
}

.tt-shared-doc-section th,
.tt-shared-doc-section td {
  padding: 0.42cqw 0.58cqw;
  border: 1px solid rgba(42, 38, 33, 0.08);
  text-align: left;
}

.tt-shared-doc-section th {
  background: #f5f3f1;
  font-weight: 600;
}

/* ── 进入视口后：生成资源 → 同步 → 协作光标 ───────────────── */

@media (prefers-reduced-motion: no-preference) {
  .feat__media .tt-product-demo--shared-resource .tt-shared-agent-result,
  .feat__media .tt-product-demo--shared-resource .tt-shared-output-card,
  .feat__media .tt-product-demo--shared-resource .tt-shared-doc-title,
  .feat__media .tt-product-demo--shared-resource .tt-shared-doc-source,
  .feat__media .tt-product-demo--shared-resource .tt-shared-doc-section,
  .feat__media .tt-product-demo--shared-resource .tt-shared-presence,
  .feat__media .tt-product-demo--shared-resource .tt-shared-collab-caret {
    opacity: 0;
    transform: translateY(0.75cqw);
  }

  .feat__media.is-demo-active .tt-product-demo--shared-resource .tt-shared-agent-result {
    animation: tt-shared-step-in 560ms cubic-bezier(.22, 1, .36, 1) 260ms both;
  }

  .feat__media.is-demo-active .tt-product-demo--shared-resource .tt-shared-output-card:nth-last-child(2) {
    animation: tt-shared-card-in 520ms cubic-bezier(.22, 1, .36, 1) 690ms both;
  }

  .feat__media.is-demo-active .tt-product-demo--shared-resource .tt-shared-output-card:last-child {
    animation: tt-shared-card-in 520ms cubic-bezier(.22, 1, .36, 1) 820ms both;
  }

  .feat__media .tt-product-demo--shared-resource .tt-shared-sync-state__pending {
    opacity: 1;
  }

  .feat__media .tt-product-demo--shared-resource .tt-shared-sync-state__done {
    opacity: 0;
  }

  .feat__media.is-demo-active .tt-product-demo--shared-resource .tt-shared-presence {
    animation: tt-shared-step-in 480ms cubic-bezier(.22, 1, .36, 1) 1040ms both;
  }

  .feat__media.is-demo-active .tt-product-demo--shared-resource .tt-shared-doc-title,
  .feat__media.is-demo-active .tt-product-demo--shared-resource .tt-shared-doc-source {
    animation: tt-shared-step-in 560ms cubic-bezier(.22, 1, .36, 1) 760ms both;
  }

  .feat__media.is-demo-active .tt-product-demo--shared-resource .tt-shared-doc-source {
    animation-delay: 900ms;
  }

  .feat__media.is-demo-active .tt-product-demo--shared-resource .tt-shared-doc-section--summary {
    animation: tt-shared-step-in 620ms cubic-bezier(.22, 1, .36, 1) 1080ms both;
  }

  .feat__media.is-demo-active .tt-product-demo--shared-resource .tt-shared-doc-section--overview {
    animation: tt-shared-step-in 620ms cubic-bezier(.22, 1, .36, 1) 1280ms both;
  }

  .feat__media.is-demo-active .tt-product-demo--shared-resource .tt-shared-collab-caret {
    animation: tt-shared-caret-in 440ms cubic-bezier(.22, 1, .36, 1) 1540ms both;
  }

  .feat__media.is-demo-active .tt-product-demo--shared-resource .tt-shared-sync-state__pending {
    animation: tt-shared-sync-pending 1320ms ease 420ms both;
  }

  .feat__media.is-demo-active .tt-product-demo--shared-resource .tt-shared-sync-state__done {
    animation: tt-shared-sync-done 420ms ease 1540ms both;
  }

  .feat__media.is-demo-active .tt-product-demo--shared-resource .tt-shared-online-dot {
    animation: tt-shared-online-pulse 3.2s ease-in-out 2s infinite;
  }
}

@keyframes tt-shared-step-in {
  from { opacity: 0; transform: translateY(0.75cqw); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tt-shared-card-in {
  from { opacity: 0; transform: translateY(0.65cqw) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tt-shared-caret-in {
  from { opacity: 0; transform: translateY(0.5cqw) scaleY(.65); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}

@keyframes tt-shared-sync-pending {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes tt-shared-sync-done {
  from { opacity: 0; transform: translateY(0.25cqw); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tt-shared-online-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 162, 110, 0); }
  50% { box-shadow: 0 0 0 0.28cqw rgba(52, 162, 110, 0.12); }
}
