/* Project dashboard v2: aligned workspaces with cache-safe asset versioning. */
@media (min-width: 1280px) {
  body:has(input[placeholder^="快速索引项目名称"]) main .max-w-7xl {
    max-width: 1480px !important;
  }

  body:has(input[placeholder^="快速索引项目名称"]) .dashboard-stats > div {
    position: relative;
    overflow: hidden;
    border-color: rgba(255, 255, 255, .075) !important;
  }

  body:has(input[placeholder^="快速索引项目名称"]) .dashboard-stats > div::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 2px;
    opacity: .65;
    background: #818cf8;
  }

  body:has(input[placeholder^="快速索引项目名称"]) .dashboard-stats > div:nth-child(2)::before {
    background: #34d399;
  }

  body:has(input[placeholder^="快速索引项目名称"]) .dashboard-stats > div:nth-child(3)::before {
    background: #fb7185;
  }

  body:has(input[placeholder^="快速索引项目名称"]) .dashboard-stats > div:nth-child(4)::before {
    background: #fbbf24;
  }

  body:has(input[placeholder^="快速索引项目名称"]) .dashboard-controls {
    padding: 10px 12px !important;
    gap: 12px !important;
  }

  body:has(input[placeholder^="快速索引项目名称"]) .dashboard-controls > :first-child {
    min-width: 300px;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table col:nth-child(1) { width: 52% !important; }
  body:has(input[placeholder^="快速索引项目名称"]) table col:nth-child(2) { width: 10% !important; }
  body:has(input[placeholder^="快速索引项目名称"]) table col:nth-child(3) { width: 15% !important; }
  body:has(input[placeholder^="快速索引项目名称"]) table col:nth-child(4) { width: 23% !important; }

  body:has(input[placeholder^="快速索引项目名称"]) table thead {
    background: rgba(255, 255, 255, .018);
  }

  body:has(input[placeholder^="快速索引项目名称"]) table th {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table td {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
  }

  /* Split the wide project cell into content and ownership lanes. */
  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:first-child > div > div.flex-1 {
    display: grid !important;
    grid-template-columns: minmax(230px, 1.25fr) minmax(210px, .9fr);
    grid-template-rows: auto auto;
    column-gap: 28px;
    align-items: center;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:first-child > div > div.flex-1 > :nth-child(1),
  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:first-child > div > div.flex-1 > :nth-child(2) {
    grid-column: 1;
    min-width: 0;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:first-child > div > div.flex-1 > :nth-child(3) {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0 !important;
    flex-wrap: wrap;
    align-content: center;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, .06);
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:first-child input[placeholder="无备注"] {
    max-width: 100% !important;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody tr {
    transition: background-color .12s ease, border-color .12s ease;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody tr:hover {
    background: rgba(255, 255, 255, .035) !important;
  }
}

/* Alignment pass: explicit baselines and clearly separated work zones. */
@media (min-width: 1280px) {
  body:has(input[placeholder^="快速索引项目名称"]) table th:first-child {
    position: relative;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table th:first-child::after {
    content: "人员分配";
    position: absolute;
    left: 58.2%;
    top: 50%;
    transform: translate(20px, -50%);
    color: rgb(100 116 139);
    font: inherit;
    letter-spacing: inherit;
    white-space: nowrap;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody tr {
    height: 78px;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody td {
    height: 78px;
    vertical-align: middle !important;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:first-child > div {
    height: 50px;
    align-items: center !important;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:first-child > div > div.flex-1 {
    height: 50px;
    grid-template-rows: 25px 20px !important;
    align-content: center;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:first-child > div > div.flex-1 > :nth-child(1) {
    align-self: end;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:first-child > div > div.flex-1 > :nth-child(2) {
    align-self: start;
    margin-top: 1px !important;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:first-child > div > div.flex-1 > :nth-child(3) {
    min-height: 40px;
    flex-wrap: nowrap !important;
    align-items: center !important;
    align-self: center;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:nth-child(2) > div,
  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:nth-child(3) > div,
  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:nth-child(4) > div {
    min-height: 50px;
    align-content: center;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:nth-child(2) > div {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:nth-child(3) > div {
    justify-content: center;
  }

  body:has(input[placeholder^="快速索引项目名称"]) table tbody td:nth-child(4) > div {
    align-items: center;
  }

  /* Queue: three unmistakable columns with a dedicated assignment surface. */
  .fast-ui .queue-view {
    max-width: 1480px !important;
  }

  .fast-ui .queue-toolbar {
    background: rgba(255, 255, 255, .045) !important;
    border-radius: 18px !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
  }

  .fast-ui .queue-list {
    gap: 12px !important;
  }

  .fast-ui .queue-item {
    grid-template-columns: minmax(380px, 1.15fr) 132px minmax(500px, 1fr) !important;
    min-height: 112px !important;
    padding: 16px 18px !important;
    gap: 18px !important;
    background: rgba(255, 255, 255, .032) !important;
    border-color: rgba(255, 255, 255, .075) !important;
    box-shadow: inset 3px 0 0 rgba(99, 102, 241, .55);
  }

  .fast-ui .queue-item > :first-child {
    padding-right: 6px;
  }

  .fast-ui .queue-desc {
    margin-top: 6px !important;
  }

  .fast-ui .queue-meta {
    margin-top: 8px !important;
  }

  .fast-ui .queue-type-cell {
    min-height: 72px !important;
    background: rgba(255, 255, 255, .018);
    border: 1px solid rgba(255, 255, 255, .055);
    border-radius: 14px;
  }

  .fast-ui .queue-actions {
    min-height: 72px;
    padding: 10px 12px;
    background: rgba(2, 6, 23, .36);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 14px;
  }

  .fast-ui .queue-row-tools {
    min-height: 40px;
  }

  /* Members: visible toolbar and a disciplined card grid. */
  .fast-ui main div.max-w-7xl:has(.member-card) {
    max-width: 1480px !important;
    padding: 0 !important;
    row-gap: 16px !important;
  }

  .fast-ui main div.max-w-7xl:has(.member-card) > :first-child {
    min-height: 64px;
    padding: 10px 12px !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .075) !important;
    border-radius: 18px;
  }

  .fast-ui .grid:has(> .member-card) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }

  .fast-ui .member-card {
    border: 1px solid rgba(255, 255, 255, .075) !important;
    background: rgba(255, 255, 255, .035) !important;
    box-shadow: inset 0 2px 0 rgba(99, 102, 241, .22) !important;
  }

  /* Logs: same toolbar/card language as the operational views. */
  .fast-ui main div.max-w-5xl:has(h2) {
    max-width: 1180px !important;
    gap: 16px !important;
  }

  .fast-ui main div.max-w-5xl:has(h2) > :first-child {
    min-height: 76px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 18px;
    align-items: center !important;
  }

  .fast-ui main div.max-w-5xl:has(h2) > :nth-child(2) {
    border-radius: 18px !important;
    border-color: rgba(255, 255, 255, .075) !important;
  }

  .fast-ui main div.max-w-5xl:has(h2) > :nth-child(2) > div > div {
    min-height: 86px;
    align-items: center;
  }

  /* Archive: wide, consistent search surface and evenly sized cards. */
  body:has(input[placeholder^="搜索结项"]) main .max-w-4xl {
    max-width: 1480px !important;
  }

  body:has(input[placeholder^="搜索结项"]) main .max-w-4xl > div > :nth-child(3) {
    min-height: 64px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 18px;
  }

  body:has(input[placeholder^="搜索结项"]) .grid[class*="md:grid-cols-2"][class*="gap-4"] > div {
    height: 132px;
    min-height: 132px !important;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  body:has(input[placeholder^="快速索引项目名称"]) table col:nth-child(1) { width: 44% !important; }
  body:has(input[placeholder^="快速索引项目名称"]) table col:nth-child(2) { width: 12% !important; }
  body:has(input[placeholder^="快速索引项目名称"]) table col:nth-child(3) { width: 18% !important; }
  body:has(input[placeholder^="快速索引项目名称"]) table col:nth-child(4) { width: 26% !important; }
}

/* Navigation: counts are useful for the live queue, but noisy for history screens. */
.fast-ui aside nav > button:nth-child(5) > span:last-child,
.fast-ui aside nav > button:nth-child(6) > span:last-child {
  display: none !important;
}
