/* WORKSPACE */
      .workspace {
        --ws-bg-alt: #141417;
        --ws-surface: #18181b;
        --ws-border: rgba(255, 255, 255, 0.07);
        --ws-border-md: rgba(255, 255, 255, 0.12);
        --ws-text-1: #ededf0;
        --ws-text-2: #a0a0a8;
        --ws-text-3: #6b6b73;
        --ws-accent: #ffffff;
        --ws-accent-hover: #e5e5ea;
        --ws-accent-soft: rgba(255, 255, 255, 0.1);
        --ws-accent-border: rgba(255, 255, 255, 0.28);
        position: relative;
        border-radius: 16px;
        padding: 16px;
        background: var(--ws-surface);
        border: 1px solid var(--ws-border);
        box-shadow:
          0 40px 80px -30px rgba(0, 0, 0, 0.7),
          inset 0 1px 1px rgba(255, 255, 255, 0.03);
        display: flex;
        flex-direction: column;
        color: var(--ws-text-1);
        font-family:
          -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
        line-height: 1.5;
      }
      .workspace-inner {
        position: relative;
        z-index: 2;
        display: grid;
        grid-template-columns: 190px 1fr 260px;
        gap: 14px;
      }
      .workspace .sidebar-left {
        background: var(--ws-bg-alt);
        border: 1px solid var(--ws-border);
        border-radius: 10px;
        padding: 18px 14px;
        display: flex;
        flex-direction: column;
        min-height: 0;
      }
      .workspace .brand {
        font-size: 22px;
        font-weight: 700;
        color: var(--ws-text-1);
        margin-bottom: 2px;
        letter-spacing: -0.02em;
      }
      .workspace .brand-sub {
        font-size: 11px;
        font-weight: 500;
        letter-spacing: 0.14em;
        color: var(--ws-text-3);
        text-transform: uppercase;
        margin-bottom: 21px;
      }
      .workspace .side-section {
        margin-bottom: 20px;
      }
      .workspace .side-label {
        font-size: 10px;
        font-weight: 500;
        color: var(--ws-text-3);
        letter-spacing: 0.05em;
        margin-bottom: 8px;
        padding-left: 8px;
        text-transform: uppercase;
      }
      .workspace .side-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 7px 9px;
        border-radius: 6px;
        font-size: 12px;
        color: var(--ws-text-2);
        margin-bottom: 1px;
        cursor: pointer;
        transition: all 0.15s ease;
        border: 1px solid transparent;
        font-family: inherit;
        background: transparent;
        width: 100%;
        text-align: left;
      }
      .workspace .side-item:hover:not(.disabled) {
        background: rgba(255, 255, 255, 0.04);
        color: var(--ws-text-1);
      }
      .workspace .side-item.active {
        background: var(--ws-accent-soft);
        color: var(--ws-text-1);
        border-color: var(--ws-accent-border);
      }
      .workspace .side-item.disabled {
        cursor: default;
      }
      .workspace .side-dot {
        width: 5px;
        height: 5px;
        border-radius: 50%;
        border: 1.5px solid rgba(255, 255, 255, 0.2);
        flex-shrink: 0;
        transition: all 0.15s ease;
      }
      .workspace .side-item.active .side-dot {
        border-color: var(--ws-accent);
        background: var(--ws-accent);
      }
      .workspace .sidebar-footer {
        margin-top: auto;
        display: flex;
        align-items: center;
        gap: 9px;
        padding-top: 14px;
        border-top: 1px solid var(--ws-border);
      }
      .workspace .avatar {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--ws-accent-soft);
        border: 1px solid var(--ws-accent-border);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 9px;
        font-weight: 700;
        color: var(--ws-accent);
        flex-shrink: 0;
      }
      .workspace .user-name {
        font-size: 11px;
        color: var(--ws-text-1);
        font-weight: 500;
      }
      .workspace .user-role {
        font-size: 9px;
        color: var(--ws-text-3);
        margin-top: 1px;
      }
      .workspace .main-content {
        background: var(--ws-bg-alt);
        border: 1px solid var(--ws-border);
        border-radius: 10px;
        position: relative;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        height: 540px;
      }
      .workspace .project-view {
        display: flex;
        flex-direction: column;
        height: 100%;
      }
      .workspace .project-header {
        padding: 20px 22px 16px;
        border-bottom: 1px solid var(--ws-border);
        flex-shrink: 0;
      }
      .workspace .project-header-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 11px;
        gap: 16px;
      }
      .workspace .project-title {
        font-size: 18px;
        font-weight: 600;
        color: var(--ws-text-1);
        letter-spacing: -0.01em;
        white-space: nowrap;
      }
      .workspace .project-status {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 10px;
        color: var(--ws-text-2);
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--ws-border);
        padding: 4px 10px;
        border-radius: 100px;
        flex-shrink: 0;
      }
      .workspace .status-dot {
        width: 4px;
        height: 4px;
        border-radius: 50%;
      }
      .workspace .steps-row {
        display: flex;
        align-items: center;
        gap: 5px;
        flex-wrap: wrap;
        margin-top: 13px;
      }
      .workspace .step-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 5px 10px;
        border-radius: 6px;
        font-size: 11px;
        color: var(--ws-text-3);
        cursor: pointer;
        transition: all 0.15s ease;
        border: 1px solid transparent;
        font-family: inherit;
        background: transparent;
        white-space: nowrap;
      }
      .workspace .step-pill:hover {
        color: var(--ws-text-2);
        background: rgba(255, 255, 255, 0.03);
      }
      .workspace .step-pill.active {
        background: var(--ws-accent-soft);
        border-color: var(--ws-accent-border);
        color: var(--ws-text-1);
      }
      .workspace .step-pill.done {
        color: var(--ws-text-2);
      }
      .workspace .step-pill-index {
        width: 13px;
        height: 13px;
        border-radius: 50%;
        border: 1.2px solid rgba(255, 255, 255, 0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 8px;
        font-weight: 600;
        flex-shrink: 0;
      }
      .workspace .step-pill.active .step-pill-index {
        border-color: var(--ws-accent);
        background: var(--ws-accent);
        color: #000;
      }
      .workspace .step-pill.done .step-pill-index {
        border-color: rgba(255, 255, 255, 0.5);
        background: rgba(255, 255, 255, 0.5);
        color: var(--ws-bg-alt);
      }
      .workspace .project-body {
        flex: 1;
        padding: 22px 24px;
        overflow-y: auto;
        min-height: 0;
      }
      .workspace .agent-block {
        margin-bottom: 26px;
      }
      .workspace .agent-block:last-child {
        margin-bottom: 0;
      }
      .workspace .agent-heading {
        font-size: 13px;
        font-weight: 600;
        color: var(--ws-text-1);
        margin-bottom: 12px;
      }
      .workspace .agent-text {
        font-size: 13px;
        line-height: 1.75;
        color: var(--ws-text-2);
        margin-bottom: 10px;
      }
      .workspace .agent-text strong {
        color: var(--ws-text-1);
        font-weight: 600;
      }
      .workspace .agent-text code {
        font-family: "SF Mono", "Menlo", "Consolas", monospace;
        font-size: 12px;
        background: rgba(255, 255, 255, 0.05);
        padding: 2px 6px;
        border-radius: 3px;
        color: var(--ws-text-1);
      }
      .workspace .agent-list {
        display: flex;
        flex-direction: column;
        gap: 5px;
        margin-bottom: 10px;
      }
      .workspace .agent-list-item {
        display: flex;
        align-items: flex-start;
        gap: 9px;
        font-size: 12px;
        line-height: 1.6;
        color: var(--ws-text-2);
        padding: 6px 9px;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.012);
      }
      .workspace .agent-list-bullet {
        width: 13px;
        height: 13px;
        border-radius: 3px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--ws-border);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        margin-top: 2px;
        font-size: 8px;
        color: var(--ws-text-3);
        font-weight: 600;
        font-family: "SF Mono", "Menlo", "Consolas", monospace;
      }
      .workspace .agent-list-item strong {
        color: var(--ws-text-1);
        font-weight: 600;
      }
      .workspace .agent-table {
        width: 100%;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid var(--ws-border);
        margin-bottom: 10px;
        font-size: 12px;
      }
      .workspace .agent-table-row {
        display: grid;
        grid-template-columns: 1.2fr 1fr 1.5fr;
        border-bottom: 1px solid var(--ws-border);
      }
      .workspace .agent-table-row:last-child {
        border-bottom: none;
      }
      .workspace .agent-table-row.header {
        background: rgba(255, 255, 255, 0.02);
        font-weight: 600;
        color: var(--ws-text-2);
        font-size: 11px;
      }
      .workspace .agent-table-cell {
        padding: 8px 12px;
        color: var(--ws-text-2);
        border-right: 1px solid var(--ws-border);
      }
      .workspace .agent-table-cell:last-child {
        border-right: none;
      }
      .workspace .agent-table-cell strong {
        color: var(--ws-text-1);
        font-weight: 600;
      }
      .workspace .agent-code {
        background: #0a0a0c;
        border: 1px solid var(--ws-border);
        border-radius: 8px;
        padding: 13px 15px;
        font-family: "SF Mono", "Menlo", "Consolas", monospace;
        font-size: 11px;
        line-height: 1.7;
        color: var(--ws-text-2);
        overflow-x: auto;
        margin-bottom: 10px;
        white-space: pre;
      }
      .workspace .agent-code .k {
        color: rgba(180, 195, 255, 0.85);
      }
      .workspace .agent-code .s {
        color: rgba(175, 215, 175, 0.8);
      }
      .workspace .agent-code .c {
        color: var(--ws-text-3);
        font-style: italic;
      }
      .workspace .agent-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 3px;
      }
      .workspace .agent-tag {
        font-size: 11px;
        color: var(--ws-text-2);
        background: rgba(255, 255, 255, 0.035);
        border: 1px solid var(--ws-border);
        padding: 3px 8px;
        border-radius: 4px;
      }
      .workspace .type-cursor {
        display: inline-block;
        width: 5px;
        height: 12px;
        background: var(--ws-accent);
        margin-left: 2px;
        vertical-align: middle;
        animation: wsBlink 1s step-end infinite;
      }
      @keyframes wsBlink {
        0%,
        100% {
          opacity: 1;
        }
        50% {
          opacity: 0;
        }
      }
      .workspace .sidebar-right {
        display: flex;
        flex-direction: column;
        gap: 14px;
        min-height: 0;
      }
      .workspace .doc-panel {
        background: var(--ws-bg-alt);
        border: 1px solid var(--ws-border);
        border-radius: 10px;
        padding: 16px 14px;
      }
      .workspace .panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
      }
      .workspace .panel-title {
        font-size: 12px;
        font-weight: 600;
        color: var(--ws-text-2);
      }
      .workspace .panel-count {
        font-size: 10px;
        color: var(--ws-text-3);
        font-weight: 500;
      }
      .workspace .doc-list {
        display: flex;
        flex-direction: column;
        gap: 1px;
      }
      .workspace .doc-row {
        display: flex;
        align-items: center;
        gap: 5px;
        animation: wsDocAppear 0.35s ease both;
      }
      @keyframes wsDocAppear {
        from {
          opacity: 0;
          transform: translateX(-4px);
        }
        to {
          opacity: 1;
          transform: translateX(0);
        }
      }
      .workspace .doc-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 8px;
        border-radius: 6px;
        font-size: 11px;
        color: var(--ws-text-2);
        cursor: pointer;
        transition: all 0.2s ease;
        border: 1px solid transparent;
        font-family: inherit;
        background: transparent;
        flex: 1;
        min-width: 0;
        text-align: left;
      }
      .workspace .doc-item:hover {
        background: rgba(255, 255, 255, 0.04);
        color: var(--ws-text-1);
      }
      .workspace .doc-item.active {
        background: var(--ws-accent-soft);
        border-color: var(--ws-accent-border);
        color: var(--ws-text-1);
      }
      .workspace .doc-icon {
        width: 15px;
        height: 15px;
        border-radius: 3px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 8px;
        font-weight: 700;
        background: rgba(255, 255, 255, 0.05);
        color: var(--ws-text-3);
        border: 1px solid var(--ws-border);
        font-family: "SF Mono", "Menlo", "Consolas", monospace;
      }
      .workspace .doc-item.active .doc-icon {
        background: var(--ws-accent-soft);
        color: var(--ws-accent);
        border-color: var(--ws-accent-border);
      }
      .workspace .doc-name {
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .workspace .doc-download {
        width: 22px;
        height: 22px;
        border-radius: 5px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--ws-border);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: default;
        flex-shrink: 0;
        opacity: 0;
        pointer-events: none;
        transition: all 0.2s ease;
        color: var(--ws-text-2);
      }
      .workspace .doc-download.show {
        opacity: 1;
        pointer-events: none;
      }
      .workspace .doc-download svg {
        width: 11px;
        height: 11px;
      }
      .workspace .assistant-card {
        background: var(--ws-bg-alt);
        border: 1px solid var(--ws-border);
        border-radius: 10px;
        padding: 16px;
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
      }
      .workspace .assistant-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 13px;
      }
      .workspace .assistant-title {
        font-size: 12px;
        font-weight: 600;
        color: var(--ws-text-1);
      }
      .workspace .assistant-sub {
        font-size: 9px;
        color: var(--ws-text-3);
        margin-top: 1px;
      }
      .workspace .assistant-messages {
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: 1;
        overflow-y: auto;
        padding-right: 2px;
      }
      .workspace .msg {
        font-size: 11px;
        line-height: 1.55;
        padding: 8px 10px;
        border-radius: 8px;
        max-width: 95%;
        word-break: break-word;
      }
      .workspace .msg-assistant {
        background: rgba(255, 255, 255, 0.035);
        color: var(--ws-text-2);
        align-self: flex-start;
      }
      .workspace .msg-user {
        background: var(--ws-accent-soft);
        color: var(--ws-text-1);
        align-self: flex-end;
      }
      .workspace .msg-assistant.typing::after {
        content: "▎";
        color: var(--ws-accent);
        animation: wsBlink 0.8s step-end infinite;
        margin-left: 1px;
      }
      .workspace .playback-bar {
        position: relative;
        z-index: 4;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-top: 14px;
        padding: 11px 16px;
        background: var(--ws-bg-alt);
        border: 1px solid var(--ws-border);
        border-radius: 10px;
        flex-wrap: wrap;
      }
      .workspace .playback-info {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 200px;
      }
      .workspace .step-counter {
        font-size: 11px;
        color: var(--ws-text-3);
        font-variant-numeric: tabular-nums;
        flex-shrink: 0;
      }
      .workspace .step-name {
        font-size: 12px;
        color: var(--ws-text-1);
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .workspace .playback-progress {
        width: 100%;
        max-width: 220px;
        height: 3px;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.05);
        overflow: hidden;
        flex-shrink: 0;
      }
      .workspace .playback-progress-fill {
        height: 100%;
        background: var(--ws-accent);
        border-radius: 2px;
        transition: width 0.4s ease;
      }
      .workspace .playback-actions {
        display: flex;
        gap: 6px;
        flex-shrink: 0;
      }
      .workspace .pb-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 7px 14px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 500;
        font-family: inherit;
        cursor: pointer;
        transition: all 0.15s ease;
        border: 1px solid var(--ws-border);
        background: rgba(255, 255, 255, 0.04);
        color: var(--ws-text-2);
      }
      .workspace .pb-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--ws-border-md);
        color: var(--ws-text-1);
      }
      .workspace .pb-btn.primary {
        background: var(--ws-accent);
        border-color: var(--ws-accent);
        color: #000;
      }
      .workspace .pb-btn.primary:hover {
        background: var(--ws-accent-hover);
      }
      .workspace .pb-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
      }
      .workspace .pb-icon {
        width: 9px;
        height: 9px;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .workspace .pb-icon.pause::before {
        content: "";
        width: 2px;
        height: 8px;
        background: currentColor;
        box-shadow: 4px 0 0 currentColor;
        transform: translateX(-2px);
      }
      .workspace .pb-icon.play::before {
        content: "";
        width: 0;
        height: 0;
        border-left: 6px solid currentColor;
        border-top: 4px solid transparent;
        border-bottom: 4px solid transparent;
      }

      .ws-modal {
        position: fixed;
        inset: 0;
        z-index: 250;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 32px;
      }
      .ws-modal.open {
        display: flex;
      }
      .ws-modal-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.78);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        animation: wsFade 0.3s ease;
      }
      @keyframes wsFade {
        from {
          opacity: 0;
        }
        to {
          opacity: 1;
        }
      }
      .ws-modal-shell {
        position: relative;
        width: min(1240px, 100%);
        max-height: calc(90vh);
        background: var(--d-alt);
        border: 1px solid var(--d-line);
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 60px 120px rgba(0, 0, 0, 0.85);
        animation: wsRise 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
        display: flex;
        flex-direction: column;
        isolation: isolate;
      }
      @keyframes wsRise {
        from {
          opacity: 0;
          transform: translateY(16px) scale(0.98);
        }
        to {
          opacity: 1;
          transform: none;
        }
      }
      .ws-modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 20px;
        border-bottom: 1px solid var(--d-line);
        background: var(--d-alt);
        flex-shrink: 0;
      }
      .ws-modal-title {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: var(--fs-sm);
        font-weight: 600;
        color: var(--d-ink);
      }
      .ws-modal-title .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
      }
      .ws-modal-close {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: grid;
        place-items: center;
        color: #c7c7cc;
        background: transparent;
        border: 1px solid transparent;
        transition:
          background 0.15s,
          border-color 0.15s,
          color 0.15s;
      }
      .ws-modal-close:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.14);
        color: #fff;
      }
      .ws-modal-close svg {
        width: 14px;
        height: 14px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
      }
      .ws-modal-body {
        flex: 1;
        overflow: auto;
        padding: 20px;
        display: flex;
        align-items: flex-start;
        justify-content: center;
      }
      .ws-modal-body .workspace {
        width: 100%;
        position: relative;
        top: auto;
        left: auto;
        transform: none !important;
        margin: 0;
      }
