/* =========================================================
   电脑端宽屏布局（body.wl-desktop-wide）—— 分档 App Shell
   ---------------------------------------------------------
   设计目标：
     • 手机/平板（<1024）继续走移动优先的 640px 单列。
     • 中等桌面（1024–1399）用两栏：左侧常驻资料卡 + 右侧双列信息流。
     • 大屏桌面（>=1400）用三栏：左资料卡 + 中双列信息流 + 右发现栏。
   根因修复：
     之前没有按视口分档，<=1199 的笔记本也被硬塞进三栏，中栏被压到
     360px，feed 卡片仅 171px，内部读书卡文字区只剩几十像素，文字被
     挤成“竖排”。现在按屏幕宽度给不同布局，保证双列卡片宽度 >=330px。
   开关位置：后台「设计 → 电脑端布局」。
   ========================================================= */

/* ---------- 0. 公共桌面增强（>=1024 即生效） ---------- */
@media (min-width: 1024px) {
    body.wl-desktop-wide .wl-navbar-inner {
        max-width: 1440px;
        padding: 0 32px;
    }
}

/* ---------- 1. 中等桌面：两栏（1024–1399） ---------- */
@media (min-width: 1024px) and (max-width: 1399px) {
    body.wl-desktop-wide.home .wl-main {
        max-width: 1100px;
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr);
        column-gap: 24px;
        row-gap: 18px;
        align-items: start;
        padding: 22px 32px 56px;
    }

    /* 左栏：资料卡 */
    body.wl-desktop-wide.home .wl-profile-header {
        grid-column: 1;
        grid-row: 1 / span 60;
        position: sticky;
        top: 80px;
        align-self: start;
        margin-bottom: 0;
        border-radius: var(--wl-radius-lg);
        box-shadow: var(--wl-shadow);
        overflow: hidden;
    }
    body.wl-desktop-wide.home .wl-profile-cover {
        position: relative;
        inset: auto;
        height: 96px;
        transform: none;
    }
    body.wl-desktop-wide.home .wl-profile-cover-overlay {
        background: linear-gradient(180deg, rgba(0, 0, 0, .12) 0%, rgba(0, 0, 0, .46) 100%);
    }
    body.wl-desktop-wide.home .wl-profile-info {
        position: relative;
        z-index: 2;
        min-height: auto;
        padding: 0 16px 16px;
        justify-content: flex-start;
    }
    body.wl-desktop-wide.home .wl-profile-avatar {
        margin-top: -30px;
        width: 68px;
        height: 68px;
        border-width: 3px;
    }
    body.wl-desktop-wide.home .wl-profile-name {
        font-size: 19px;
    }
    body.wl-desktop-wide.home .wl-profile-details {
        font-size: 12px;
    }
    body.wl-desktop-wide.home .wl-profile-bio {
        margin-top: 10px;
        font-size: 12px;
        -webkit-line-clamp: 3;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    body.wl-desktop-wide.home .wl-profile-bottom-row {
        flex-direction: column;
        align-items: stretch;
        gap: 9px;
    }
    body.wl-desktop-wide.home .wl-profile-stats {
        justify-content: space-around;
    }
    body.wl-desktop-wide.home .wl-edit-profile-btn {
        justify-content: center;
    }
    body.wl-desktop-wide.home .wl-profile-stories {
        display: none;
    }

    /* 中栏：view-tabs / 筛选 / 标签云 / feed 双列 */
    body.wl-desktop-wide.home .wl-view-tabs,
    body.wl-desktop-wide.home .wl-feed-visibility-filter,
    body.wl-desktop-wide.home .wl-tag-filter-bar,
    body.wl-desktop-wide.home .wl-tag-cloud-section,
    body.wl-desktop-wide.home .wl-feed,
    body.wl-desktop-wide.home .wl-load-more-wrap {
        grid-column: 2;
    }
    body.wl-desktop-wide.home .wl-feed {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        align-items: start;
    }
    body.wl-desktop-wide.home .wl-feed > .wl-trip-home-card {
        grid-column: 1 / -1;
    }

    /* 右栏在两栏模式下不存在 */
    body.wl-desktop-wide.home .wl-desktop-aside {
        display: none;
    }
}

/* ---------- 2. 大屏桌面：三栏（>=1400） ---------- */
@media (min-width: 1400px) {
    body.wl-desktop-wide.home .wl-main {
        max-width: 1440px;
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr) 280px;
        column-gap: 24px;
        row-gap: 18px;
        align-items: start;
        padding: 24px 32px 56px;
    }

    /* 左栏：资料卡 */
    body.wl-desktop-wide.home .wl-profile-header {
        grid-column: 1;
        grid-row: 1 / span 60;
        position: sticky;
        top: 80px;
        align-self: start;
        margin-bottom: 0;
        border-radius: var(--wl-radius-lg);
        box-shadow: var(--wl-shadow);
        overflow: hidden;
    }
    body.wl-desktop-wide.home .wl-profile-cover {
        position: relative;
        inset: auto;
        height: 108px;
        transform: none;
    }
    body.wl-desktop-wide.home .wl-profile-cover-overlay {
        background: linear-gradient(180deg, rgba(0, 0, 0, .12) 0%, rgba(0, 0, 0, .46) 100%);
    }
    body.wl-desktop-wide.home .wl-profile-info {
        position: relative;
        z-index: 2;
        min-height: auto;
        padding: 0 18px 18px;
        justify-content: flex-start;
    }
    body.wl-desktop-wide.home .wl-profile-avatar {
        margin-top: -34px;
        width: 74px;
        height: 74px;
        border-width: 3px;
    }
    body.wl-desktop-wide.home .wl-profile-name {
        font-size: 21px;
    }
    body.wl-desktop-wide.home .wl-profile-details {
        font-size: 12px;
    }
    body.wl-desktop-wide.home .wl-profile-bio {
        margin-top: 12px;
        font-size: 13px;
        -webkit-line-clamp: 4;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    body.wl-desktop-wide.home .wl-profile-bottom-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    body.wl-desktop-wide.home .wl-profile-stats {
        justify-content: space-around;
    }
    body.wl-desktop-wide.home .wl-edit-profile-btn {
        justify-content: center;
    }
    body.wl-desktop-wide.home .wl-profile-stories {
        display: none;
    }

    /* 中栏 */
    body.wl-desktop-wide.home .wl-view-tabs,
    body.wl-desktop-wide.home .wl-feed-visibility-filter,
    body.wl-desktop-wide.home .wl-tag-filter-bar,
    body.wl-desktop-wide.home .wl-feed,
    body.wl-desktop-wide.home .wl-load-more-wrap {
        grid-column: 2;
    }
    body.wl-desktop-wide.home .wl-feed {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
        align-items: start;
    }
    body.wl-desktop-wide.home .wl-feed > .wl-trip-home-card {
        grid-column: 1 / -1;
    }

    /* 右栏：发现栏 */
    body.wl-desktop-wide.home .wl-desktop-aside {
        grid-column: 3;
        grid-row: 1 / span 60;
        position: sticky;
        top: 80px;
        align-self: start;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    /* 标签云归位到右栏，避免中栏重复 */
    body.wl-desktop-wide.home .wl-tag-cloud-section {
        display: none;
    }
}

/* ---------- 3. 相册视图 ---------- */
@media (min-width: 1024px) and (max-width: 1399px) {
    body.wl-desktop-wide.home .wl-photo-grid-section {
        grid-column: 2;
        grid-row: 2 / span 60;
    }
    body.wl-desktop-wide.home .wl-photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
}
@media (min-width: 1400px) {
    body.wl-desktop-wide.home .wl-photo-grid-section {
        grid-column: 2;
        grid-row: 2 / span 60;
    }
    body.wl-desktop-wide.home .wl-photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 10px;
    }
}

/* ---------- 4. 子页面：仅加宽外壳 ---------- */
@media (min-width: 1024px) {
    body.wl-desktop-wide:not(.home) .wl-main {
        max-width: 1280px;
        padding: 24px 32px 56px;
    }
}

/* ---------- 5. 右栏卡片内部样式 ---------- */
.wl-aside-card {
    background: var(--wl-bg-card, #fff);
    border: 1px solid var(--wl-border-light, rgba(0, 0, 0, .06));
    border-radius: var(--wl-radius-lg, 18px);
    box-shadow: var(--wl-shadow, 0 6px 20px rgba(0, 0, 0, .06));
    padding: 16px 18px;
}
.wl-aside-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--wl-text, #1c1c1e);
    letter-spacing: .01em;
}
.wl-aside-quick {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wl-aside-quick a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--wl-text, #1c1c1e);
    text-decoration: none;
    font-size: 14px;
    transition: background .2s ease;
}
.wl-aside-quick a:hover {
    background: rgba(0, 0, 0, .04);
}
.wl-aside-quick svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--wl-accent, #c08a7d);
}
.wl-aside-tags .wl-tag-cloud {
    gap: 8px;
}
.wl-aside-stats-row {
    display: flex;
    gap: 22px;
}
.wl-aside-stat-num {
    font-size: 21px;
    font-weight: 800;
    color: var(--wl-text, #1c1c1e);
    line-height: 1.1;
}
.wl-aside-stat-label {
    margin-top: 4px;
    font-size: 12px;
    color: var(--wl-text-muted, #8a8a8e);
}

/* ---------- 6. 读书卡在小列宽下改为纵向，避免文字被压成短行 ---------- */
@media (min-width: 1024px) {
    body.wl-desktop-wide.home .wl-feed .wl-reading-book {
        flex-direction: column;
    }
    body.wl-desktop-wide.home .wl-feed .wl-reading-cover {
        width: 64px;
        height: 90px;
    }
    body.wl-desktop-wide.home .wl-feed .wl-reading-main {
        min-width: 0;
    }
}
@media (min-width: 1400px) {
    /* 三栏中列更宽，恢复横向封面+文字 */
    body.wl-desktop-wide.home .wl-feed .wl-reading-book {
        flex-direction: row;
    }
    body.wl-desktop-wide.home .wl-feed .wl-reading-cover {
        width: 88px;
        height: 124px;
    }
}
