/* 星火学苑 · 教室大屏个人空间
   单一主样式：对应 js/adventure_base.js 的 render()。
   默认由大屏编辑展示内容，教师可切换为手机端管理，不在这里加入课堂玩法规则。 */

#modal-collection.is-personal-space .collection-content {
    width: 1120px !important;
    height: 630px !important;
    max-width: calc(100vw - 48px) !important;
    max-height: calc(100vh - 48px) !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
}

#collection-game-overview {
    min-width: 0;
    min-height: 0;
}

.adventure-base {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    overflow: hidden;
    position: relative;
    border: 0;
    border-radius: 20px;
    background: #151d2d;
    box-sizing: border-box;
}

.ps-left {
    width: 37%;
    flex: 0 0 37%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 26px 28px 30px;
    overflow: hidden;
    position: relative;
    color: #fff;
    border: 0;
    box-sizing: border-box;
}

.adventure-base[data-theme="fire"],
.ps-left-fire {
    background: linear-gradient(155deg, #ff7445 0%, #e85031 54%, #c93c2c 100%);
}

.adventure-base[data-theme="water"],
.ps-left-water {
    background: linear-gradient(155deg, #5fc8ee 0%, #3194d2 56%, #2871b8 100%);
}

.adventure-base[data-theme="grass"],
.ps-left-grass {
    background: linear-gradient(155deg, #76c75e 0%, #5aae4c 56%, #458f43 100%);
}

.adventure-base[data-theme="electric"],
.ps-left-electric {
    background: linear-gradient(155deg, #f4d95d 0%, #d9ae39 58%, #b97925 100%);
}

.adventure-base[data-theme="psychic"],
.ps-left-psychic {
    background: linear-gradient(155deg, #d8a0de 0%, #a966bd 56%, #774692 100%);
}

.adventure-base[data-theme="ice"],
.ps-left-ice {
    background: linear-gradient(155deg, #8bdae6 0%, #43b8cc 56%, #2c879f 100%);
}

.adventure-base[data-theme="mech"],
.ps-left-mech {
    background: linear-gradient(155deg, #9aaeb7 0%, #647983 56%, #465863 100%);
}

.adventure-base[data-theme="ghost"],
.ps-left-ghost {
    background: linear-gradient(155deg, #bdabe0 0%, #8769bd 56%, #5c458f 100%);
}

.adventure-base[data-theme="fairy"],
.ps-left-fairy {
    background: linear-gradient(155deg, #f3a9c4 0%, #df6f9c 56%, #b94f7b 100%);
}

/* 恢复原来的浅色属性底纹，保持低透明度和静态绘制。 */
.ps-pattern {
    position: absolute;
    inset: -30px;
    right: -80px;
    opacity: 0.06;
    font-size: 5.5rem;
    color: #fff;
    z-index: 0;
    pointer-events: none;
    line-height: 1;
}

.ps-pattern .prow {
    display: flex;
    gap: 50px;
    margin-bottom: 30px;
}

.ps-pattern .prow:nth-child(even) {
    margin-left: 55px;
}

.ps-pattern i {
    transform: rotate(-20deg);
    flex-shrink: 0;
}

.ps-student-label {
    max-width: 100%;
    min-width: 0;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px 0 8px;
    border-radius: 999px;
    background: rgba(20, 32, 28, 0.48);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    box-sizing: border-box;
}

.ps-student-label strong {
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-student-row {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ps-hunger-badge,
.ps-mobile-sync {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(20, 32, 28, 0.48);
    box-sizing: border-box;
}

.ps-hunger-badge {
    color: var(--hunger-color, #dfffc2);
    font-size: 17px;
}

.ps-mobile-sync {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    margin-left: auto;
    color: rgba(255, 255, 255, 0.72);
    font-size: 17px;
}

.ps-label-icon {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    font-size: 13px;
}

.ps-pet-stage {
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0 12px;
    box-sizing: border-box;
}

.ps-pet {
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ps-pet-base,
.ps-companion-base {
    position: absolute;
    z-index: 0;
    display: block;
    border-radius: 50%;
    background: rgba(8, 23, 21, 0.38);
    pointer-events: none;
}

.ps-pet-base {
    left: 50%;
    bottom: 10%;
    width: 54%;
    height: 24px;
    transform: translateX(-50%);
}

.ab-pet-img {
    display: block;
    position: relative;
    z-index: 1;
    width: auto;
    height: 350px;
    max-width: 96%;
    max-height: 100%;
    object-fit: contain;
    animation: none !important;
}

/* 旧 Lv1-Lv5 恢复升级前的个人空间尺寸；Lv6+ 保持当前成长阶段尺寸。 */
.adventure-base[data-pet-stage="legacy"] .ab-pet-img {
    height: 260px;
    max-width: 90%;
    transform: none;
}

.ps-pet-status {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(20, 20, 18, 0.4);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-sizing: border-box;
}

.ps-hunger-pill,
.ps-level-pill {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border-radius: 999px;
    white-space: nowrap;
    box-sizing: border-box;
    font-weight: 700;
}

.ps-hunger-pill i {
    color: var(--hunger-color, #dfffc2);
}

.ps-level-pill {
    background: transparent;
}

.ps-level-pill b,
.ps-xp-percent {
    color: #ffe85d;
    font-size: 15px;
}

.ps-level-pill b {
    font-weight: 700;
}

.ps-status-divider {
    width: 1px;
    height: 20px;
    flex: 0 0 1px;
    background: rgba(255, 255, 255, 0.46);
}

.ps-xp-label {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.88);
}

.ps-xp-bar {
    width: 110px;
    height: 10px;
    flex: 0 1 110px;
    display: block;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(20, 57, 28, 0.7);
}

.ps-xp-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #d7f83f;
}

.ps-xp-percent {
    flex: 0 0 auto;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.ps-pet-status .ps-hunger-pill,
.ps-pet-status .ps-level-pill,
.ps-pet-status .ps-xp-label,
.ps-pet-status .ps-xp-percent {
    font-weight: 700;
}

/* 让状态条在窄屏上保持一行可读。 */
.ps-pet-status > span,
.ps-pet-status > b {
    flex: 0 0 auto;
}

.ps-pet-status > .ps-pet-name {
    min-width: 0;
    flex: 0 1 86px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
    font-weight: 700;
}

/* 防止文本在状态条内部挤压出布局。 */
.ps-pet-status .ps-hunger-pill,
.ps-pet-status .ps-level-pill,
.ps-pet-status .ps-xp-label,
.ps-pet-status .ps-xp-percent {
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-showcase-heading {
    width: 100%;
    min-height: 28px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
}

.ps-showcase-heading strong {
    font-weight: 700;
}

.ps-showcase-heading span {
    display: none;
}

.ps-showcases {
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    position: static;
}

.ps-show-frame {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border: 0;
    border-radius: 13px;
    background: rgba(20, 20, 18, 0.4);
    box-sizing: border-box;
}

.ps-show-frame.equipped {
    background: rgba(20, 20, 18, 0.4);
}

.ps-show-frame.empty {
    color: rgba(255, 255, 255, 0.42);
}

.ps-show-frame.is-editable {
    appearance: none;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.ps-show-frame.is-editable:active {
    transform: scale(0.98);
}

.ps-show-frame-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-show-frame-image img,
.ps-show-frame-image .ink-badge-icon {
    width: 86%;
    height: 86%;
    object-fit: contain;
}

.ps-show-frame-state {
    position: absolute;
    right: 5px;
    bottom: 5px;
    max-width: calc(100% - 10px);
    padding: 3px 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(33, 54, 29, 0.82);
    color: #edffd9;
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-show-frame-image.is-missing::after,
.ps-gcard-img.is-missing::after,
.ps-companion-visual.is-missing::after {
    content: '图片暂未加载';
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 800;
}

.ps-right {
    width: 63%;
    flex: 0 0 63%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 22px 26px 18px;
    overflow: hidden;
    position: relative;
    color: #fff;
    background: #0b2945;
    box-sizing: border-box;
}

.ps-close {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 4;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #244b6b;
    border-radius: 50%;
    background: #153753;
    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
    cursor: pointer;
}

.ps-close:active,
.ps-tab:active,
.ps-filter-tab:active {
    transform: scale(0.96);
}

.ps-tabs {
    width: 420px;
    max-width: 100%;
    flex: 0 0 56px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    margin: 0 auto 14px;
    padding: 5px;
    border: 1px solid #244b6b;
    border-radius: 999px;
    background: #102f4d;
}

.ps-tab {
    min-width: 0;
    width: 100%;
    height: auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.56);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
}

.ps-tab.active {
    background: #3189e8;
    box-shadow: none;
    color: #fff;
}

.ps-content {
    width: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.ps-view {
    display: none !important;
    width: 100%;
    min-width: 0;
    min-height: 0;
}

.ps-view.active {
    display: block !important;
}

.ps-view.active.ps-info-view {
    height: 100%;
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) 204px;
    gap: 10px;
}

.ps-view.active.ps-collection-view {
    height: 100%;
    display: flex !important;
    flex-direction: column;
}

.ps-info-view {
    min-height: 0;
}

.ps-info-top {
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.03fr);
    gap: 14px;
}

.ps-info-card {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #214766;
    border-radius: 15px;
    background: #0b2945;
    box-sizing: border-box;
}

.ps-companion-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-color: #315467;
    background-color: #143847;
    background-image: none;
}

.ps-companion-card.is-route-green-meadow {
    border-color: #315467;
    background-color: #143847;
}

.ps-companion-card.is-route-deep-blue {
    border-color: #2d6070;
    background-color: #12384b;
}

.ps-companion-card.is-route-wonderlight {
    border-color: #5a5276;
    background-color: #302b4a;
}

.ps-companion-pattern {
    position: absolute;
    inset: 0;
    z-index: 0;
    box-sizing: border-box;
    color: rgba(215, 233, 189, 0.12);
    opacity: 0.72;
    pointer-events: none;
}

.ps-companion-card.is-route-deep-blue .ps-companion-pattern {
    color: rgba(150, 226, 239, 0.13);
}

.ps-companion-card.is-route-wonderlight .ps-companion-pattern {
    color: rgba(221, 196, 255, 0.13);
}

.ps-companion-pattern i {
    position: absolute;
    display: block;
    font-size: 30px;
    transform: rotate(-20deg);
}

.ps-companion-pattern i:nth-child(1) {
    top: 34%;
    left: 5%;
}

.ps-companion-pattern i:nth-child(2) {
    top: 22%;
    right: 8%;
}

.ps-companion-pattern i:nth-child(3) {
    top: 58%;
    right: 19%;
}

.ps-companion-heading,
.ps-companion-visual {
    position: relative;
    z-index: 1;
}

.ps-companion-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    overflow: hidden;
    padding: 12px 12px 4px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    text-align: center;
    white-space: nowrap;
}

.ps-companion-heading > strong {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-companion-heading-separator {
    color: rgba(255, 255, 255, 0.42);
}

.ps-companion-visual {
    width: 100%;
    height: auto;
    flex: 1 1 auto;
    min-height: 224px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 4px 12px 12px;
    background: transparent;
    box-sizing: border-box;
}

.ps-companion-base {
    left: 50%;
    top: 73%;
    width: 38%;
    height: 18px;
    background: rgba(5, 20, 23, 0.42);
    transform: translate(-50%, -50%);
}

.ps-companion-visual > img {
    display: block;
    position: relative;
    z-index: 1;
    width: 68%;
    height: 68%;
    object-fit: contain;
    opacity: 0.9;
    transform: translateY(-6px);
}

.ps-companion-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 14px 10px;
    background: transparent;
    box-sizing: border-box;
}

.ps-companion-overlay > strong {
    display: block;
    overflow: hidden;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-companion-pills {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 0;
    overflow: hidden;
}

.ps-companion-pills span {
    min-width: 0;
    max-width: none;
    overflow: hidden;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(151, 189, 138, 0.42);
    background: rgba(10, 29, 36, 0.28);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-companion-pills span.is-active {
    color: #ffe85d;
    border-color: rgba(255, 232, 93, 0.58);
}

.ps-companion-card.is-empty .ps-companion-visual {
    background: transparent;
}

.ps-companion-card.is-empty {
    border-color: #214766;
    background: #0b2945;
}

.ps-companion-card.is-empty .ps-companion-pattern {
    display: none;
}

.ps-companion-card.is-empty .ps-companion-heading {
    color: rgba(255, 255, 255, 0.68);
}

.ps-companion-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.36);
    font-size: 13px;
    font-weight: 800;
}

.ps-companion-placeholder i {
    font-size: 26px;
    opacity: 0.72;
}

.ps-card-heading {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
    display: flex;
    align-items: baseline;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-align: left;
}

.ps-card-heading > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-card-heading strong {
    color: rgba(255, 255, 255, 0.72);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.ps-calendar-card {
    display: flex;
    flex-direction: column;
    padding: 13px 15px 11px;
}

.ps-calendar-weekdays,
.ps-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    column-gap: 4px;
}

.ps-calendar-weekdays {
    margin-top: 10px;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.46);
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

.ps-calendar-grid {
    row-gap: 3px;
    align-content: start;
    flex: 1 1 auto;
    min-height: 0;
}

.ps-calendar-day {
    min-width: 0;
    min-height: 30px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 8px;
    border: 0;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    box-sizing: border-box;
}

.ps-calendar-day.is-blank {
    visibility: hidden;
}

.ps-calendar-day.is-future {
    color: rgba(255, 255, 255, 0.24);
}

.ps-calendar-day.is-checked {
    background: transparent;
    color: #b7ed91;
}

.ps-calendar-day.is-today {
    border-color: #e4ca55;
    border-style: solid;
    border-width: 1px;
    background: #263a48;
    color: #ffe98f;
}

.ps-calendar-day i {
    position: absolute;
    width: 100%;
    right: auto;
    bottom: 2px;
    left: 0;
    font-size: 8px;
    line-height: 1;
    text-align: center;
}

.ps-calendar-day.is-checked i {
    color: #67d88a;
}

.ps-calendar-foot {
    flex: 0 0 auto;
    margin-top: 7px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-align: right;
}

.ps-calendar-foot b {
    color: #f3d56e;
    font-size: 21px;
    font-weight: 700;
}

.ps-info-overview {
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 11px 14px 13px;
    overflow: hidden;
    border: 1px solid #214766;
    border-radius: 15px;
    background: #0b2945;
    box-sizing: border-box;
}

.ps-section-label {
    flex: 0 0 auto;
    margin-bottom: 10px;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
}

.ps-collection-overview {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ps-collection-overview-item {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-items: center;
    justify-content: initial;
    gap: 4px;
    padding: 8px 8px 9px;
    overflow: hidden;
    border: 1px solid #214766;
    border-radius: 11px;
    background: #10304d;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    box-sizing: border-box;
}

.ps-collection-overview-item > strong {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.ps-collection-overview-icon {
    width: 100%;
    min-height: 0;
    height: 72px;
    max-height: 72px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b4e88b;
}

.ps-collection-overview-icon picture {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-collection-overview-icon picture img {
    display: block;
    width: auto;
    max-width: 82%;
    height: auto;
    max-height: 62px;
    object-fit: contain;
}

.ps-collection-overview-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-collection-overview-item b {
    color: #ffe85d;
    font-size: 16px;
    font-weight: 700;
}

/* 收藏页：概况、分类和 4 列藏品卡片都放在右侧，不改变手机保存逻辑。 */
.ps-collection-view .ps-showcase-manager {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ps-collection-readonly-note {
    flex: 0 0 auto;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0;
    color: #fff;
}

.ps-collection-readonly-note strong {
    font-size: 18px;
    font-weight: 900;
}

.ps-collection-readonly-note > span {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: #153753;
    color: rgba(255, 255, 255, 0.82);
    font-size: 11px;
    font-weight: 900;
}

.ps-filter-tabs {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 0;
}

.ps-filter-tab {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    border: 1px solid #244b6b;
    border-radius: 999px;
    background: #153753;
    color: rgba(255, 255, 255, 0.56);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    box-sizing: border-box;
}

.ps-filter-tab.active {
    border-color: #6cb0f2;
    background: #3189e8;
    color: #fff;
}

.ps-filter-tab span {
    display: none;
}

.ps-showcase-gallery {
    min-height: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    /* 让隐式行按卡片实际高度展开，避免多行时行轨道被压缩而互相覆盖。 */
    grid-auto-rows: max-content;
    align-content: start;
    gap: 10px;
    overflow-y: auto;
    padding: 0 3px 6px 0;
    box-sizing: border-box;
}

.ps-showcase-gallery.is-empty {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ps-showcase-gallery::-webkit-scrollbar {
    width: 7px;
}

.ps-showcase-gallery::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.ps-showcase-gallery::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
}

.ps-gcard {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    position: relative;
    border: 1px solid #214766;
    border-radius: 13px;
    background: #0b2945;
    color: inherit;
    font: inherit;
    text-align: center;
    box-sizing: border-box;
}

.ps-readonly-card {
    height: auto;
    aspect-ratio: 0.9 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-color: #244b6b;
    border-radius: 12px;
    isolation: isolate;
}

.ps-gcard-img {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.26);
}

.ps-readonly-card .ps-gcard-img {
    position: absolute;
    inset: 4px 6px 46px;
    z-index: 0;
    width: auto;
    height: auto;
    flex: 0 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.ps-gcard-img img {
    max-width: 84%;
    max-height: 84%;
    object-fit: contain;
}

.ps-readonly-card .ps-gcard-img img {
    max-width: 90% !important;
    max-height: 90% !important;
}

/* 大屏图鉴卡保留方形卡面，让正方形透明飞船按整张卡面计算尺寸。 */
.ps-readonly-card .ps-gcard-name {
    position: absolute;
    right: 6px;
    bottom: 31px;
    left: 6px;
    z-index: 1;
    min-height: 20px;
    padding: 3px 5px;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(11, 41, 69, 0.08) 0%, rgba(11, 41, 69, 0.9) 100%);
}

.ps-readonly-card .ps-gcard-meta {
    position: absolute;
    right: 6px;
    bottom: 6px;
    left: 6px;
    z-index: 2;
    width: auto;
    max-width: none;
    margin: 0;
}

.ps-gcard-img .ink-badge-icon,
.ps-show-frame .ink-badge-icon {
    width: 64px;
    height: 64px;
    display: inline-block;
    flex: 0 0 auto;
    background-repeat: no-repeat;
    border-radius: 12px;
}

.ps-gcard-name {
    min-width: 0;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 7px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

.ps-gcard-meta {
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    max-width: calc(100% - 12px);
    margin: 0 6px 6px;
    padding: 3px 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #153753;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

.ps-gcard-meta-toggle {
    width: calc(100% - 12px);
    min-width: 0;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.ps-gcard-meta-toggle .ps-gcard-meta-action {
    display: inline-flex;
}

.ps-gcard-meta-toggle:not(.is-set) {
    border-color: rgba(108, 176, 242, 0.52);
    background: #3189e8;
    color: #fff;
}

.ps-gcard-meta-toggle.is-set {
    border-color: rgba(116, 200, 111, 0.46);
    background: #3c8d58;
    color: #d8f7c8;
}

.ps-gcard-meta-toggle:active {
    transform: scale(0.97);
}

.ps-gcard-state {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 2;
    max-width: calc(100% - 14px);
    padding: 4px 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #153753;
    color: rgba(255, 255, 255, 0.76);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-gcard-count {
    position: absolute;
    right: 7px;
    bottom: 7px;
    z-index: 2;
    padding: 4px 7px;
    border-radius: 999px;
    background: #f0d45d;
    color: #283022;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.ps-readonly-card .ps-gcard-state {
    background: #153753;
}

.ps-limited-month-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    z-index: 3;
    max-width: calc(100% - 14px);
    min-height: 18px;
    padding: 0 7px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    color: #42617f;
    font-size: 9px;
    font-weight: 900;
    line-height: 18px;
    white-space: nowrap;
    text-overflow: ellipsis;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.ps-limited-month-badge[data-limited-month="2026-09"] {
    color: #b75f55;
    background: rgba(255, 239, 232, 0.94);
}

.ps-limited-month-badge[data-limited-month="2026-10"] {
    color: #765ca5;
    background: rgba(242, 234, 255, 0.94);
}

.ps-limited-month-badge[data-limited-month="2026-11"] {
    color: #287d78;
    background: rgba(226, 248, 242, 0.94);
}

.ps-limited-month-badge[data-limited-month="2026-12"] {
    color: #4b5f88;
    background: rgba(232, 240, 255, 0.94);
}

.ps-limited-month-badge[data-limited-month="2027-01"] {
    color: #b2713e;
    background: rgba(255, 244, 220, 0.96);
}

.ps-limited-month-badge[data-limited-month="2027-02"] {
    color: #a65354;
    background: rgba(255, 235, 226, 0.96);
}

.ps-readonly-card .ps-gcard-state + .ps-gcard-img {
    padding-top: 7px;
}

.ps-gcard-state.set,
.ps-readonly-card .ps-gcard-state {
    color: #eaffd6;
}

.ps-gcard-state.full {
    color: rgba(255, 255, 255, 0.38);
}

.ps-showcase-empty,
.ps-readonly-empty {
    grid-column: 1 / -1;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px dashed #244b6b;
    border-radius: 13px;
    color: rgba(255, 255, 255, 0.46);
    font-size: 14px;
    font-weight: 900;
    box-sizing: border-box;
}

.ps-showcase-gallery.is-empty > .ps-readonly-empty {
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
}

.ps-showcase-empty i,
.ps-readonly-empty i {
    color: rgba(255, 255, 255, 0.42);
    font-size: 24px;
}

.ps-showcase-empty span,
.ps-readonly-empty span {
    color: rgba(255, 255, 255, 0.32);
    font-size: 11px;
    font-weight: 700;
}

.ps-image-fallback-icon {
    color: rgba(255, 255, 255, 0.3);
    font-size: 22px;
}

.ink-badge-card.ink-rarity-common { border-color: rgba(170, 190, 210, 0.34); }
.ink-badge-card.ink-rarity-rare { border-color: rgba(58, 210, 118, 0.4); }
.ink-badge-card.ink-rarity-epic { border-color: rgba(178, 92, 255, 0.48); }
.ink-badge-card.ink-rarity-legendary { border-color: rgba(255, 204, 74, 0.54); }
.ink-badge-card.ink-rarity-mythic { border-color: rgba(91, 222, 255, 0.58); }

.ab-no-pet {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.ab-no-pet i {
    color: rgba(255, 255, 255, 0.42);
    font-size: 48px;
}

.ab-no-pet strong {
    color: #fff;
    font-size: 18px;
}

.ab-no-pet span {
    max-width: 360px;
    font-size: 13px;
}

@media (max-width: 1168px) {
    #modal-collection.is-personal-space .collection-content {
        width: calc(100vw - 48px) !important;
    }

    .ps-left {
        padding-left: 18px;
        padding-right: 18px;
    }

    .ps-right {
        padding-left: 18px;
        padding-right: 20px;
    }

    .ps-info-top {
        gap: 10px;
    }

    .ps-calendar-card {
        padding-left: 12px;
        padding-right: 12px;
    }

    .ps-calendar-weekdays,
    .ps-calendar-grid {
        column-gap: 2px;
    }
}

@media (max-height: 720px) {
    #modal-collection.is-personal-space .collection-content {
        height: calc(100vh - 32px) !important;
        max-height: calc(100vh - 32px) !important;
    }

    .ps-left {
        padding-top: 16px;
        padding-bottom: 14px;
    }

    .ab-pet-img {
        height: 310px;
    }

    .adventure-base[data-pet-stage="legacy"] .ab-pet-img {
        height: 270px;
    }

    .ps-show-frame {
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .ps-right {
        padding-top: 15px;
        padding-bottom: 12px;
    }

    .ps-info-top {
        gap: 10px;
    }

    .ps-view.active.ps-info-view {
        grid-template-rows: minmax(0, 1fr) 164px;
        gap: 8px;
    }

    .ps-companion-visual {
        min-height: 190px;
    }

    .ps-calendar-day {
        min-height: 21px;
    }

    .ps-collection-overview-item {
        min-height: 46px;
    }
}

@media (max-width: 760px) {
    #modal-collection.is-personal-space .collection-content {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
    }

    .adventure-base {
        border-radius: 16px;
    }

    .ps-left {
        width: 37%;
        flex-basis: 37%;
        padding-left: 10px;
        padding-right: 10px;
    }

    .ps-right {
        width: 63%;
        flex-basis: 63%;
        padding-left: 11px;
        padding-right: 11px;
    }

    .ps-student-label {
        padding-right: 8px;
        font-size: 12px;
    }

    .ps-student-row {
        gap: 4px;
    }

    .ps-mobile-sync {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    .ps-label-icon {
        width: 22px;
        height: 22px;
        flex-basis: 22px;
        font-size: 11px;
    }

    .ps-pet-status {
        gap: 4px;
        padding-left: 9px;
        padding-right: 9px;
        font-size: 10px;
    }

    .ps-pet-status .ps-status-divider {
        height: 18px;
    }

    .ps-pet-status > .ps-pet-name {
        flex-basis: 48px;
        font-size: 16px;
    }

    .ps-xp-bar {
        width: 64px;
        flex-basis: 64px;
    }

    .ps-hunger-pill,
    .ps-level-pill {
        min-height: 23px;
        padding: 0 6px;
    }

    .ps-showcase-heading {
        font-size: 11px;
    }

    .ps-showcases {
        gap: 4px;
    }

    .ps-show-frame {
        height: auto;
        aspect-ratio: 1 / 1;
        border-radius: 9px;
    }

    .ps-close {
        top: 8px;
        right: 8px;
        width: 30px;
        height: 30px;
    }

    .ps-tabs {
        width: calc(100% - 42px);
        max-width: 420px;
        flex-basis: 43px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 9px;
        gap: 4px;
        padding: 4px;
    }

    .ps-tab {
        min-width: 0;
        min-height: 33px;
        padding: 0 7px;
        font-size: 11px;
    }

    .ps-info-top {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 6px;
    }

    .ps-companion-visual {
        min-height: 140px;
    }

    .ps-companion-overlay {
        padding: 0 8px 8px;
    }

    .ps-companion-heading,
    .ps-companion-overlay > strong,
    .ps-companion-pills span,
    .ps-calendar-day,
    .ps-calendar-weekdays,
    .ps-calendar-foot,
    .ps-section-label,
    .ps-collection-overview-item,
    .ps-gcard-name,
    .ps-gcard-meta {
        font-size: 9px;
    }

    .ps-companion-heading > strong {
        font-size: 10px;
    }

    .ps-companion-pills {
        gap: 3px;
        margin-top: 7px;
    }

    .ps-companion-pills span {
        padding: 4px 5px;
    }

    .ps-calendar-card {
        padding: 8px 7px 7px;
    }

    .ps-card-heading {
        font-size: 10px;
        gap: 4px;
    }

    .ps-card-heading strong {
        font-size: 9px;
    }

    .ps-calendar-weekdays {
        margin-top: 7px;
        margin-bottom: 3px;
    }

    .ps-calendar-day {
        min-height: 17px;
        padding-bottom: 5px;
    }

    .ps-calendar-day i {
        bottom: 1px;
        font-size: 6px;
    }

    .ps-calendar-foot {
        font-size: 10px;
    }

    .ps-calendar-foot b {
        font-size: 14px;
    }

    .ps-collection-overview {
        gap: 3px;
    }

    .ps-collection-overview-item {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr) auto;
        justify-items: center;
        gap: 2px;
        padding: 4px 2px;
        text-align: center;
    }

    .ps-collection-overview-icon {
        height: 42px;
    }

    .ps-collection-overview-icon picture img {
        height: 34px;
        max-height: 34px;
    }

    .ps-collection-overview-item > strong {
        font-size: 11px;
    }

    .ps-collection-overview-item i {
        font-size: 12px;
    }

    .ps-collection-overview-item b {
        font-size: 9px;
    }

    .ps-collection-readonly-note strong {
        font-size: 13px;
    }

    .ps-filter-tabs {
        gap: 3px;
        margin-bottom: 0;
    }

    .ps-filter-tab {
        min-height: 27px;
        flex: 1 1 30%;
        padding: 0 4px;
        font-size: 9px;
    }

    .ps-showcase-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: auto;
        gap: 6px;
    }

    .ps-readonly-card {
        height: auto;
    }

    .ps-readonly-card .ps-gcard-img {
        inset: 4px 4px 35px;
        width: auto;
        height: auto;
        flex-basis: auto;
    }

    .ps-readonly-card .ps-gcard-name {
        right: 4px;
        bottom: 25px;
        left: 4px;
        min-height: 18px;
        padding: 2px 4px;
    }

    .ps-readonly-card .ps-gcard-meta {
        right: 4px;
        bottom: 4px;
        left: 4px;
    }
}
