/**
 * 手机端样式（设计稿要求：顶栏 Tab、底栏、Feed 流）
 */
:root {
    --rwcmw-red: #e33635;
    --rwcmw-red-dark: #c51925;
    --rwcmw-text: #333;
    --rwcmw-text-muted: #999;
    --rwcmw-border: #e3e3e3;
    --rwcmw-tabbar-h: 56px;
    --rwcmw-white: #fff;
}

.rwcmw-mobile-sticky-top { display: none; }

.rwcmw-mobile-search {
    background: var(--rwcmw-red);
    padding: 6px 4% 10px;
}

.rwcmw-mobile-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rwcmw-mobile-search-input {
    position: relative;
    flex: 1;
}

.rwcmw-mobile-search-input input {
    width: 100%;
    height: 34px;
    border: none;
    border-radius: 17px;
    padding: 0 14px 0 36px;
    background: rgba(255,255,255,.22);
    color: #fff;
    font-size: 14px;
    outline: none;
}

.rwcmw-mobile-search-input input::placeholder { color: rgba(255,255,255,.85); }

.rwcmw-mobile-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .9;
    filter: brightness(0) invert(1);
}

.rwcmw-mobile-search-btn {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 14px;
    padding: 0 4px;
    cursor: pointer;
}

.rwcmw-mobile-tabs {
    display: none;
    background: var(--rwcmw-red);
    position: relative;
    z-index: 1;
}

.rwcmw-mobile-tabs-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.rwcmw-mobile-tabs-scroll {
    flex: 1;
    min-width: 0;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-right: 52px;
}

.rwcmw-mobile-tabs-scroll::-webkit-scrollbar { display: none; }

.rwcmw-mobile-tab {
    flex-shrink: 0;
    padding: 0 16px;
    line-height: 40px;
    color: rgba(255,255,255,.85);
    font-size: 14px;
    white-space: nowrap;
}

.rwcmw-mobile-tab.active {
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 -3px 0 #fff;
}

.rwcmw-mobile-tabs-more {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 52px;
    border: none;
    background: linear-gradient(90deg, rgba(227,54,53,0) 0%, var(--rwcmw-red) 28%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding-left: 12px;
    z-index: 2;
}

.rwcmw-mobile-tabs-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #fff;
    border: 1px solid var(--rwcmw-border);
    border-top: none;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
    max-height: 280px;
    overflow-y: auto;
    z-index: 90;
}

.rwcmw-mobile-tabs-dropdown[hidden] { display: none; }

.rwcmw-mobile-tabs-dropdown-item {
    display: block;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--rwcmw-text);
    border-bottom: 1px solid #f0f0f0;
}

.rwcmw-mobile-tabs-dropdown-item.active,
.rwcmw-mobile-tabs-dropdown-item:hover {
    color: var(--rwcmw-red);
    background: #fafafa;
}

.rwcmw-mobile-tabbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--rwcmw-tabbar-h);
    background: var(--rwcmw-white);
    border-top: 1px solid var(--rwcmw-border);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.rwcmw-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--rwcmw-text-muted);
    padding-top: 4px;
}

.rwcmw-tab-item.active { color: var(--rwcmw-red); }

.rwcmw-tab-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: .6;
}

.rwcmw-tab-item.active .rwcmw-tab-icon { opacity: 1; }

.rwcmw-tab-icon-home {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e33635'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
}

.rwcmw-tab-icon-lecture {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3 1 9l11 6 9-4.91V17h2V9L12 3z'/%3E%3C/svg%3E");
}

.rwcmw-tab-item.active .rwcmw-tab-icon-lecture {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e33635'%3E%3Cpath d='M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3 1 9l11 6 9-4.91V17h2V9L12 3z'/%3E%3C/svg%3E");
}

.rwcmw-tab-icon-contact {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
}

.rwcmw-tab-item.active .rwcmw-tab-icon-contact {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e33635'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
}

@media (max-width: 767px) {
    /* 重置源站 PC 固定宽度 */
    html,
    body.rwcmw-body {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
        text-align: left;
        zoom: 1 !important;
        -webkit-text-size-adjust: 100%;
    }

    body.rwcmw-body > div,
    body.rwcmw-body > main,
    body.rwcmw-body > nav,
    body.rwcmw-body > a {
        max-width: 100%;
    }

    .rwcmw-pc-header,
    .rwcmw-pc-banner,
    .rwcmw-pc-section { display: none !important; }

    .rwcmw-hide-mobile { display: none !important; }
    .rwcmw-show-mobile { display: block !important; width: 100%; }

    .rwcmw-main {
        overflow: visible;
        min-width: 0;
        width: 100%;
    }

    body.rwcmw-body {
        padding-bottom: calc(var(--rwcmw-tabbar-h) + env(safe-area-inset-bottom));
        background: #f5f5f5;
    }

    body.rwcmw-body:not(.rwcmw-no-mobile-sticky) .rwcmw-main {
        padding-top: 88px;
    }

    body.rwcmw-sticky-compact:not(.rwcmw-no-mobile-sticky) .rwcmw-main {
        padding-top: 52px;
    }

    .footer {
        min-width: 0 !important;
        width: 100% !important;
        margin-top: 0;
        padding: 20px 12px;
        box-sizing: border-box;
    }

    .footer p {
        font-size: 12px;
        line-height: 1.8;
        word-break: break-all;
    }

    /* 手机顶栏 */
    .rwcmw-mobile-sticky-top {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        box-shadow: 0 2px 8px rgba(0,0,0,.08);
    }

    .rwcmw-mobile-tabs { display: block; }

    .rwcmw-mobile-tabbar { display: flex; }

    /* Banner */
    .rwcmw-mobile-banner { width: 100%; }

    .rwcmw-mobile-banner-slide { display: none; }
    .rwcmw-mobile-banner-slide.active { display: block; }

    .rwcmw-mobile-banner-slide img {
        width: 100%;
        height: 200px;
        object-fit: cover;
    }

    .rwcmw-mobile-headlines {
        background: #fff;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .rwcmw-mobile-headlines li a {
        display: block;
        padding: 10px 14px;
        color: #333;
        font-size: 14px;
        border-bottom: 1px solid #f0f0f0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .rwcmw-mobile-headlines li.active a {
        color: var(--rwcmw-red);
        font-weight: 600;
    }

    /* 看视频 */
    .rwcmw-videos { width: 100%; margin-bottom: 8px; }

    .rwcmw-mobile-section-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px;
        background: #fff;
        border-bottom: 1px solid #eee;
    }

    .rwcmw-mobile-section-head h2 {
        margin: 0;
        font-size: 16px;
        color: var(--rwcmw-red);
    }

    .rwcmw-mobile-section-head a { font-size: 13px; color: #999; }

    .rwcmw-video-grid {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 10px;
        padding: 12px;
        background: #fff;
    }

    .rwcmw-video-grid::-webkit-scrollbar { display: none; }

    .rwcmw-video-card {
        flex: 0 0 42%;
        max-width: 42%;
        scroll-snap-align: start;
        color: inherit;
    }

    .rwcmw-video-cover img {
        width: 100%;
        height: 110px;
        object-fit: cover;
        border-radius: 4px;
    }

    .rwcmw-video-cover {
        position: relative;
        display: block;
    }

    .rwcmw-video-play {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.55);
        pointer-events: none;
        z-index: 2;
    }

    .rwcmw-video-play::after {
        content: '';
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-38%, -50%);
        border-style: solid;
        border-width: 7px 0 7px 12px;
        border-color: transparent transparent transparent #fff;
    }

    .rwcmw-list-video-grid {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .rwcmw-list-video-grid .rwcmw-video-card {
        flex: 0 0 calc(50% - 5px);
        max-width: calc(50% - 5px);
    }

    .rwcmw-feed-thumb {
        position: relative;
        margin-top: 8px;
    }

    .rwcmw-feed-thumb .rwcmw-video-play {
        width: 36px;
        height: 36px;
    }

    .rwcmw-feed-thumb .rwcmw-video-play::after {
        border-width: 6px 0 6px 10px;
    }

    .rwcmw-video-title {
        margin: 6px 0 0;
        font-size: 13px;
        line-height: 1.35;
        white-space: normal;
    }

    /* Feed */
    .rwcmw-home-mobile { width: 100%; }

    .rwcmw-mobile-feed-section { margin-bottom: 8px; }

    .rwcmw-mobile-feed-section-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
        background: #f0f0f0;
    }

    .rwcmw-mobile-feed-section-head h3 {
        margin: 0;
        font-size: 15px;
        font-weight: 700;
    }

    .rwcmw-mobile-feed-section-head a { font-size: 13px; color: #999; }

    .rwcmw-list-page,
    .rwcmw-search-page,
    .rwcmw-detail-page,
    .rwcmw-about-page {
        width: 100%;
    }

    .rwcmw-list-page-feed .rwcmw-feed-item:last-child,
    .rwcmw-related-feed .rwcmw-feed-item:last-child {
        margin-bottom: 0;
    }

    .rwcmw-feed-item {
        padding: 12px;
        margin-bottom: 8px;
        background: #fff;
    }

    .rwcmw-feed-title {
        margin: 0 0 8px;
        font-size: 17px;
        font-weight: 700;
        line-height: 1.45;
        color: #131313;
    }

    .rwcmw-feed-body { display: block; color: inherit; }

    .rwcmw-feed-body:hover { color: inherit; }

    .rwcmw-feed-content {
        display: grid;
        grid-template-columns: 1fr 105px;
        gap: 12px;
        align-items: start;
    }

    .rwcmw-feed-content.has-triple { grid-template-columns: 1fr; }

    .rwcmw-feed-summary {
        margin: 0;
        font-size: 14px;
        color: #3f3f3f;
        line-height: 1.55;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .rwcmw-feed-image-single {
        width: 110px;
        height: 74px;
        object-fit: cover;
        border-radius: 4px;
    }

    .rwcmw-feed-images-triple {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        margin-top: 10px;
    }

    .rwcmw-feed-images-triple img {
        width: 100%;
        aspect-ratio: 4/3;
        object-fit: cover;
        border-radius: 2px;
    }

    .rwcmw-feed-stats {
        margin-top: 8px;
        font-size: 12px;
        color: var(--rwcmw-text-muted);
    }

    .rwcmw-empty-compact {
        padding: 24px 16px;
        text-align: center;
        color: #999;
        background: #fff;
    }

    /* 手机详情/关于 */
    .rwcmw-detail-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px;
        background: #fff;
        border-bottom: 1px solid #eee;
    }

    .rwcmw-detail-share {
        color: #e33635;
        font-size: 15px;
        text-decoration: none;
    }

    .rwcmw-share-modal.rwcmw-share-modal-mobile {
        align-items: flex-end;
        padding: 0;
    }

    .rwcmw-share-modal.rwcmw-share-modal-mobile .rwcmw-share-dialog {
        width: 100%;
        border-radius: 14px 14px 0 0;
        overflow: hidden;
    }

    .rwcmw-share-modal.rwcmw-share-modal-mobile .rwcmw-share-header,
    .rwcmw-share-modal.rwcmw-share-modal-mobile .rwcmw-share-close {
        display: none;
    }

    .rwcmw-share-modal.rwcmw-share-modal-mobile .rwcmw-share-pc-panel {
        display: none;
    }

    .rwcmw-share-modal.rwcmw-share-modal-mobile .rwcmw-share-mobile-panel {
        display: block;
    }

    .rwcmw-share-wechat-actions {
        margin: 0;
        padding: 8px 0 0;
        list-style: none;
    }

    .rwcmw-share-wechat-actions li + li {
        border-top: 1px solid #f0f0f0;
    }

    .rwcmw-share-wechat-btn {
        display: flex;
        align-items: center;
        gap: 14px;
        width: 100%;
        padding: 16px 20px;
        border: 0;
        background: #fff;
        text-align: left;
        box-sizing: border-box;
    }

    .rwcmw-share-wechat-btn .rwcmw-share-icon {
        flex: 0 0 auto;
        width: 44px;
        height: 44px;
        background-size: 22px 22px;
    }

    .rwcmw-share-wechat-text {
        font-size: 16px;
        color: #333;
    }

    .rwcmw-share-mobile-cancel {
        display: block;
        width: 100%;
        margin-top: 8px;
        padding: 16px 20px;
        border: 0;
        border-top: 8px solid #f5f5f5;
        background: #fff;
        font-size: 16px;
        color: #666;
    }

    .rwcmw-share-body {
        padding: 0;
    }

    .rwcmw-wechat-guide-panel {
        top: 88px;
    }

    .rwcmw-share-link-row {
        flex-wrap: wrap;
    }

    .rwcmw-share-link-row label {
        width: 100%;
        margin-bottom: 6px;
    }

    .rwcmw-share-channels {
        gap: 18px;
    }

    .rwcmw-share-icon {
        width: 46px;
        height: 46px;
        background-size: 24px 24px;
    }

    .rwcmw-share-label {
        font-size: 12px;
    }

    .rwcmw-detail-back { color: #333; font-size: 16px; }

    .rwcmw-detail-body { padding: 16px; background: #fff; }

    .rwcmw-detail-header h1 {
        margin: 0 0 10px;
        font-size: 20px;
        line-height: 1.4;
        color: #333;
    }

    .rwcmw-detail-meta {
        font-size: 13px;
        color: #999;
    }

    .rwcmw-detail-meta span { margin-left: 12px; }

    .rwcmw-detail-content {
        margin-top: 16px;
        word-wrap: break-word;
    }

    .rwcmw-detail-content.w-e-phone {
        padding: 0 4px;
    }

    .rwcmw-detail-content .editor_img_close,
    .rwcmw-detail-content .editor_video_close,
    .rwcmw-detail-content .editor_audio_close,
    .rwcmw-detail-content .editor_img_title,
    .rwcmw-detail-content .editor_video_title,
    .rwcmw-detail-content .editor_audio_title {
        display: none !important;
    }

    .rwcmw-detail-content img { max-width: 100%; height: auto; }

    .rwcmw-detail-video {
        padding: 0 14px 12px;
        background: #000;
    }

    .rwcmw-detail-video .rwcmw-video-player-wrap {
        margin: 0;
        padding-top: 56.25%;
    }

    .rwcmw-detail-content video {
        max-width: 100%;
        height: auto;
    }

    .rwcmw-detail-page .rwcmw-article-adjacent {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: stretch;
        gap: 16px;
        margin: 0;
        padding: 16px;
        background: #fafafa;
    }

    .rwcmw-detail-page .rwcmw-adjacent-col {
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 8px);
    }

    .rwcmw-detail-page .rwcmw-adjacent-col-prev {
        text-align: left;
    }

    .rwcmw-detail-page .rwcmw-adjacent-col-next {
        text-align: right;
    }

    .rwcmw-detail-page .rwcmw-adjacent-col-next .rwcmw-adjacent-label::after {
        margin-left: auto;
    }

    .rwcmw-detail-page .rwcmw-adjacent-item {
        display: block;
        color: inherit;
        text-decoration: none;
    }

    .rwcmw-detail-page .rwcmw-adjacent-label {
        display: block;
        height: 36px;
        line-height: 36px;
        font-size: 15px;
        color: #333;
    }

    .rwcmw-detail-page .rwcmw-adjacent-col-prev .rwcmw-adjacent-label::after,
    .rwcmw-detail-page .rwcmw-adjacent-col-next .rwcmw-adjacent-label::after {
        content: '';
        display: block;
        width: 20px;
        height: 1px;
        background-color: #ddd;
    }

    .rwcmw-detail-page .rwcmw-adjacent-title {
        display: block;
        margin-top: 8px;
        font-size: 13px;
        line-height: 1.45;
        color: #666;
        word-break: break-all;
    }

    .rwcmw-related-mobile-head {
        padding: 12px 14px;
        font-size: 15px;
        font-weight: 700;
        background: #f0f0f0;
    }

    /* 单页：保留通用顶栏，正文区留白 */
    .rwcmw-about-page .rwcmw-detail-topbar {
        justify-content: center;
    }

    .rwcmw-about-mobile-title {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
        line-height: 1.35;
        text-align: center;
    }

    .rwcmw-about-content-wrap {
        padding: 12px;
        box-sizing: border-box;
    }

    .rwcmw-about-content {
        background: #fff;
        padding: 16px;
        border-radius: 8px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        color: #333;
    }

    .rwcmw-about-content.w-e-phone {
        padding: 16px;
    }

    .rwcmw-about-page .rwcmw-detail-content {
        margin-top: 0;
    }

    .rwcmw-about-content img,
    .rwcmw-about-content video,
    .rwcmw-about-content iframe {
        max-width: 100%;
        height: auto;
    }

    .rwcmw-about-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rwcmw-about-content .editor_img_close,
    .rwcmw-about-content .editor_video_close,
    .rwcmw-about-content .editor_audio_close,
    .rwcmw-about-content .editor_img_title,
    .rwcmw-about-content .editor_video_title,
    .rwcmw-about-content .editor_audio_title {
        display: none !important;
    }

    .rwcmw-back-top-link {
        bottom: auto;
    }

    #rwcmw-suspension.suspension {
        display: none !important;
    }

    .pagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 6px;
        width: auto;
        max-width: 100%;
        margin: 16px auto;
        padding: 0 12px;
        float: none;
        overflow: visible;
    }

    .pagination li {
        float: none;
        margin: 0;
    }

    .rwcmw-pagination-wrap {
        padding: 8px 0 16px;
        text-align: center;
    }
}
