/* Mobile refinements: full VPS names and responsive list cards. */
@media (max-width: 720px) {
  .server-card-title-link,
  .compact-node-title,
  .mini-node-title,
  .node-list-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    overflow-wrap: normal;
    word-break: normal;
    max-height: none;
    -webkit-line-clamp: unset;
    line-height: 1.5;
  }
  .server-card-title-link,
  .compact-node-title { font-size: var(--mobile-name-font-size, 16px); }
  .mini-node-title,
  .node-list-name { font-size: var(--mobile-name-font-size, 15px); }

  .server-card-header,
  .compact-node-header {
    align-items: center;
    gap: 8px;
  }
  .server-card-title-row,
  .compact-node-title-row,
  .node-list-node-head {
    align-items: center;
  }
  .server-card-title-row > :first-child,
  .compact-node-title-row > :first-child,
  .node-list-node-head > :first-child {
    flex-shrink: 0;
    margin-top: 0;
  }
  .server-card-actions,
  .compact-node-actions {
    flex-shrink: 0;
    gap: 2px;
  }
  .server-card-title-block,
  .compact-node-title-wrap {
    flex: 1 1 0%;
  }
  .compact-node-title {
    flex: 1 1 0%;
  }
  .server-card-content,
  .compact-node-card,
  .mini-node-card {
    min-width: 0;
  }

  /* Reserve an independent full-width title row in mini cards. */
  .mini-node-header {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto auto;
    align-items: start;
    gap: 6px;
  }
  .mini-node-header > :first-child {
    grid-column: 1;
    grid-row: 1;
    margin-top: 0;
    align-self: center;
  }
  .mini-node-title {
    grid-column: 2 / -1;
    grid-row: 1;
    font-size: var(--mobile-name-font-size, 15px);
  }
  .mini-node-header > .node-traffic-trigger {
    grid-column: 3;
    grid-row: 2;
  }
  .mini-node-os {
    grid-column: 4;
    grid-row: 2;
  }

  /* Replace the wide desktop table with labelled, readable mobile rows. */
  .node-list-scroll {
    overflow: visible;
    box-shadow: none;
  }
  .node-list {
    min-width: 0;
    width: 100%;
    border: 0;
    background: transparent;
    overflow: visible;
    gap: 12px;
  }
  .node-list-head {
    display: none;
  }
  .node-list-row:not(.node-list-head) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-a);
    box-shadow: var(--shadow-card);
  }
  .node-list-row.is-offline {
    border-color: var(--status-offline);
  }
  .node-list-row > .node-list-node,
  .node-list-row > .col-os {
    grid-column: 1 / -1;
  }
  .node-list-name {
    font-size: var(--mobile-name-font-size, 15px);
  }
  .node-list-node-text {
    gap: 8px;
  }
  .node-list-chips {
    flex-wrap: wrap;
    max-height: none;
    overflow: visible;
  }
  .node-list-row > .col-os {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hairline);
  }
  .node-list-os-name {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .node-list-row > .col-load,
  .node-list-row > .col-net {
    display: flex;
  }
  .node-list-row > .node-list-cell:not(.node-list-node):not(.col-os) {
    flex-direction: column;
    align-self: stretch;
    justify-content: flex-start;
    gap: 5px;
  }
  .node-list-row > .node-list-cell:not(.node-list-node):not(.col-os)::before {
    display: block;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
  }
  .node-list-row > :nth-child(3)::before { content: "CPU"; }
  .node-list-row > :nth-child(4)::before { content: "内存"; }
  .node-list-row > :nth-child(5)::before { content: "磁盘"; }
  .node-list-row > .col-load::before { content: "负载"; }
  .node-list-row > .col-live::before { content: "实时速率"; }
  .node-list-row > .col-traffic::before { content: "累计流量"; }
  .node-list-row > .col-net::before { content: "网络延迟"; }
  .node-list-row > .col-life::before { content: "在线 / 到期"; }
  .node-list-traffic-rows {
    align-items: center;
  }
  .node-list-line {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}
