/* 首页选型按设备空间重新组织：手机用直接操作清单，平板保留选择与预览，桌面沿用左右工作台。 */

@media (max-width: 600px) {
  body.home-page.home-authed {
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--bg) !important;
    color: var(--ink);
  }

  body.home-page.home-authed > .sa-nav,
  body.home-page.home-authed > .accent-dock {
    display: none !important;
  }

  body.home-page.home-authed > .sa-tabs {
    position: fixed;
    z-index: 500;
    left: 12px;
    right: 12px;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: auto;
    height: 62px;
    padding: 5px;
    border: 1px solid var(--line-md);
    border-radius: 18px;
    background: color-mix(in srgb, var(--bg-mid) 94%, transparent);
    box-shadow: 0 12px 32px rgba(20, 30, 52, .18);
    backdrop-filter: blur(18px) saturate(1.12);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
  }

  body.home-page.home-authed > .sa-tabs .sa-tab {
    min-width: 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    padding: 4px 2px;
    border-radius: 13px;
    color: var(--ink-faint);
    font-size: 10px;
    text-transform: none;
  }

  body.home-page.home-authed > .sa-tabs .sa-tab svg {
    width: 20px;
    height: 20px;
  }

  body.home-page.home-authed > .sa-tabs .sa-tab.active {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
  }

  body.home-page.home-authed .workspace {
    min-height: 100svh;
    padding: 0 !important;
    overflow: visible;
    background-color: var(--bg) !important;
    background-image: radial-gradient(120% 36% at 100% 0, color-mix(in srgb, var(--accent) 8%, transparent), transparent 72%);
    background-attachment: scroll;
  }

  body.home-page.home-authed .lobby {
    width: 100%;
    max-width: none;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.home-page.home-authed .workspace-manifesto,
  body.home-page.home-authed .section-head:not(.toolkit-head):not(#recentHead),
  body.home-page.home-authed .mode-mobile-guide,
  body.home-page.home-authed .mode-preview {
    display: none !important;
  }

  body.home-page.home-authed .mobile-workspace-bar {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 28px;
  }

  body.home-page.home-authed .mwb-home {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    text-decoration: none;
  }

  body.home-page.home-authed .mwb-wordmark-mark {
    width: 32px;
    height: 32px;
  }

  body.home-page.home-authed .mwb-wordmark-mark .spark-tile {
    fill: var(--accent);
  }

  body.home-page.home-authed .mwb-wordmark-mark .spark-book {
    fill: none;
    stroke: rgba(255, 255, 255, .58);
    stroke-width: 1.25;
    stroke-linejoin: round;
  }

  body.home-page.home-authed .mwb-wordmark-mark .spark-glyph {
    fill: #fff;
  }

  body.home-page.home-authed .mwb-actions > a,
  body.home-page.home-authed .mwb-actions > .mwb-profile {
    display: none !important;
  }

  body.home-page.home-authed .mwb-actions > #mobileWorkspaceTheme {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-md);
    border-radius: 13px;
    color: var(--ink-dim);
    background: var(--surface);
  }

  body.home-page.home-authed .mobile-workspace-head {
    display: block;
    margin: 0 0 18px;
  }

  body.home-page.home-authed .mobile-workspace-head h1 {
    margin: 0;
    color: var(--ink);
    font: 760 25px/1.25 var(--font-s);
    letter-spacing: -.035em;
  }

  body.home-page.home-authed .mobile-workspace-head p {
    margin: 6px 0 0;
    color: var(--ink-dim);
    font-size: 13px;
    line-height: 1.55;
  }

  body.home-page.home-authed .mode-split {
    display: block;
    margin: 0 0 30px;
  }

  body.home-page.home-authed .mode-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line-md);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 5px 20px rgba(28, 43, 70, .045);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.home-page.home-authed .mode-list::before,
  body.home-page.home-authed .mode-item::before {
    display: none;
  }

  body.home-page.home-authed .mode-item,
  body.home-page.home-authed .mode-item:first-child {
    position: relative;
    width: 100%;
    min-height: 76px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    color: var(--ink);
    text-align: left;
    background: transparent;
    box-shadow: none;
    transform: none !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  body.home-page.home-authed .mode-item:last-child {
    border-bottom: 0;
  }

  body.home-page.home-authed .mode-item:hover,
  body.home-page.home-authed .mode-item.active {
    background: color-mix(in srgb, var(--mc) 5%, var(--surface));
    box-shadow: none;
  }

  body.home-page.home-authed .mode-item:active {
    background: color-mix(in srgb, var(--mc) 9%, var(--surface));
  }

  body.home-page.home-authed .mode-item:focus-visible {
    z-index: 1;
    outline: 3px solid color-mix(in srgb, var(--mc) 50%, transparent);
    outline-offset: -3px;
  }

  body.home-page.home-authed .mi-index,
  body.home-page.home-authed .mi-en {
    display: none !important;
  }

  body.home-page.home-authed .mi-icon,
  body.home-page.home-authed .mode-item.active .mi-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 12px;
    color: var(--mc);
    background: color-mix(in srgb, var(--mc) 12%, var(--bg-soft));
    filter: none;
    opacity: 1;
    box-shadow: none;
  }

  body.home-page.home-authed .mi-icon svg {
    width: 21px;
    height: 21px;
  }

  body.home-page.home-authed .mi-text {
    min-width: 0;
    display: block;
    flex: 1 1 auto;
  }

  body.home-page.home-authed .mi-name {
    display: block;
    color: var(--ink);
    font: 700 15px/1.3 var(--font-s);
  }

  body.home-page.home-authed .mi-desc {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 3px;
    color: var(--ink-dim);
    font-size: 11px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.home-page.home-authed .mi-arrow,
  body.home-page.home-authed .mode-item.active .mi-arrow {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    flex: 0 0 24px;
    color: var(--ink-faint);
    font: 400 22px/1 var(--font-s);
    opacity: .8;
    transform: none;
  }

  body.home-page.home-authed .toolkit-head {
    display: flex;
    margin: 24px 0 10px;
  }

  body.home-page.home-authed .toolkit-head .section-title {
    color: var(--ink-dim);
    font-size: 14px;
    font-weight: 650;
  }

  body.home-page.home-authed .tool-cards {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    margin: 0 0 28px;
    border: 1px solid var(--line-md);
    border-radius: 15px;
    background: var(--surface);
  }

  body.home-page.home-authed .tool-card {
    min-height: 68px;
    display: flex;
    gap: 11px;
    padding: 11px 13px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.home-page.home-authed .tool-card:last-child {
    border-bottom: 0;
  }

  body.home-page.home-authed .tool-card::before {
    display: none;
  }

  body.home-page.home-authed .tool-card-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    margin: 0;
    border: 0;
    border-radius: 11px;
  }

  body.home-page.home-authed .tool-card-meta {
    display: none;
  }

  body.home-page.home-authed .tool-card-title {
    margin: 0 0 2px;
    color: var(--ink);
    font-size: 14px;
  }

  body.home-page.home-authed .tool-card-desc {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink-dim);
    font-size: 11px;
    line-height: 1.4;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  body.home-page.home-authed .tool-card-action {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.home-page.home-authed #recentHead {
    display: flex !important;
    margin: 20px 0 10px;
  }

  body.home-page.home-authed #recentHead .section-title {
    font-size: 14px;
  }

  body.home-page.home-authed .recent-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
}

@media (min-width: 601px) and (max-width: 980px) {
  body.home-page.home-authed .lobby {
    width: 100%;
    max-width: 100%;
    padding: 28px 24px 100px;
  }

  body.home-page.home-authed .mode-split {
    display: grid;
    grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
    align-items: stretch;
    gap: 16px;
    margin-bottom: 28px;
  }

  body.home-page.home-authed .mode-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px;
    overflow: visible;
  }

  body.home-page.home-authed .mode-list::before {
    top: 10px;
    left: 18px;
  }

  body.home-page.home-authed .mode-item,
  body.home-page.home-authed .mode-item:first-child {
    min-width: 0;
    min-height: 58px;
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 10px;
    border-radius: 12px;
    scroll-snap-align: none;
  }

  body.home-page.home-authed .mode-item .mi-desc {
    display: none;
  }

  body.home-page.home-authed .mode-item .mi-en {
    display: block;
  }

  body.home-page.home-authed .mode-preview {
    min-width: 0;
    min-height: 350px;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(180px, .72fr);
    gap: 18px;
    padding: 24px;
    transform: none;
  }

  body.home-page.home-authed .mp-copy {
    min-width: 0;
  }

  body.home-page.home-authed .mp-visual {
    min-width: 0;
    min-height: 210px;
  }

  body.home-page.home-authed .mp-stat {
    display: none !important;
  }

  body.home-page.home-authed .tool-cards {
    gap: 12px;
  }
}

@media (min-width: 601px) and (max-width: 759px) {
  body.home-page.home-authed .lobby {
    padding: 24px 20px 100px;
  }

  body.home-page.home-authed .mode-split {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  body.home-page.home-authed .mode-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
    border-radius: 18px;
  }

  body.home-page.home-authed .mode-list::before {
    top: 13px;
    left: 20px;
  }

  body.home-page.home-authed .mode-item:first-child {
    margin-top: 22px;
  }

  body.home-page.home-authed .mode-item,
  body.home-page.home-authed .mode-item:first-child {
    min-height: 80px;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 9px;
    border-radius: 12px;
  }

  body.home-page.home-authed .mode-item .mi-icon {
    display: none;
  }

  body.home-page.home-authed .mode-item .mi-en {
    display: none;
  }

  body.home-page.home-authed .mode-item .mi-desc {
    display: block;
    overflow: hidden;
    color: var(--ink-dim);
    font-size: 10px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.home-page.home-authed .mode-preview {
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 0;
    padding: 22px;
  }

  body.home-page.home-authed .mp-visual {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home-page.home-authed .mode-item,
  body.home-page.home-authed .tool-card {
    scroll-behavior: auto;
    transition: none;
  }
}

/* Phone home is a direct creation list, not a card nested inside the desktop preview. */
@media (max-width: 600px) {
  body.home-page.home-authed .mode-list {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.home-page.home-authed .mode-item,
  body.home-page.home-authed .mode-item:first-child {
    padding-right: 8px;
    padding-left: 8px;
    border-radius: 0;
  }

  body.home-page.home-authed .mode-item:last-child {
    border-bottom: 0;
  }

  body.home-page.home-authed .mi-desc {
    font-size: 12px;
    line-height: 1.45;
  }

  body.home-page.home-authed .tool-card-desc {
    font-size: 12px;
    line-height: 1.45;
  }

  html:not(.theme-light) body.home-page.home-authed .workspace {
    background-color: var(--bg) !important;
    background-image: radial-gradient(120% 36% at 100% 0, color-mix(in srgb, var(--accent) 9%, transparent), transparent 72%);
  }
}
