/* ==================== 全局变量与重置 ==================== */
:root {
    --keyboard-inset: 0px;
    --primary: #ff2442;
    --primary-light: #ff6b81;
    --primary-dark: #d91a37;
    --primary-bg: #fff0f0;
    --brand-purple: #6c5ce7;
    --bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border: #eeeeee;
    --danger: #ff2442;
    --success: #27ae60;
    --warning: #f39c12;
    --shadow: none;
    --shadow-lg: none;
    --radius: 6px;
    --radius-sm: 6px;
    --radius-lg: 10px;
    --header-h: 44px;
    --bottom-nav-h: 50px;
    --max-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    min-height: 100dvh;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #ffffff;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--primary);
    text-decoration: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

input, textarea {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    background: none;
}

/* 图片防护全局样式 */
img {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
}

/* 全局隐藏滚动条（小红书极简风格） */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* ==================== 顶部导航 ==================== */
.xzs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 12px;
}

.header-left {
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--brand-purple);
}

.logo-brand-image {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
    object-position: center;
    border: 1px solid rgba(114, 96, 173, 0.32);
    border-radius: 9px;
    box-shadow: 0 3px 10px rgba(63, 45, 90, 0.16);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-purple);
    white-space: nowrap;
}

.header-center {
    flex: 1;
    max-width: 400px;
}

/* 移动端header中间的tab栏 */
.header-mobile-tabs {
    display: none;
}

/* 移动端搜索按钮（仅移动端显示） */
.header-search-btn {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.search-box {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 18px;
    padding: 0 12px;
    height: 32px;
    transition: background 0.2s;
}

.search-box:focus-within {
    background: #eee;
}

.search-box .search-icon {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    padding: 0 8px;
    font-size: 13px;
}

.header-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 顶栏头像（通过media query控制显隐） */

.btn-post {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--primary);
    color: #fff;
    padding: 5px 14px;
    height: 28px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-post:active {
    background: var(--primary-dark);
}

.btn-post svg {
    flex-shrink: 0;
}

.avatar-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid var(--border);
    transition: border-color 0.2s;
}

.avatar-wrap:hover {
    border-color: var(--primary-light);
}

.avatar-wrap img,
.avatar-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    pointer-events: none;
}

/* ==================== 主内容区 ==================== */
.xzs-main {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 769px) {
    .xzs-main {
        bottom: 0;
    }
}

.view {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-bottom: calc(var(--bottom-nav-h) + 20px);
}

@media (min-width: 769px) {
    .view {
        padding-bottom: 40px;
    }
}

/* ==================== Feed Tab Bar（关注/发现/附近） ==================== */
.feed-tab-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 10px 12px 8px;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 11;
}

.feed-tab {
    position: relative;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-tertiary);
    padding: 4px 0;
    transition: color 0.2s, font-weight 0.2s;
}

.feed-tab.active {
    color: var(--text-primary);
    font-weight: 700;
}

.feed-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

/* 开发中占位 */
.feed-placeholder {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-tertiary);
}

.feed-placeholder svg {
    margin-bottom: 12px;
}

.feed-placeholder p {
    font-size: 14px;
}

/* ==================== 排序栏（二级，仅"发现"tab下显示） ==================== */
.sort-bar {
    display: flex;
    gap: 6px;
    padding: 4px 12px 6px;
    background: #fff;
    position: relative;
    z-index: 9;
    justify-content: center;
    border-radius: 0;
}

.sort-item {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-tertiary);
    background: transparent;
    border-radius: 12px;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
}

.sort-item.active {
    background: #f5f5f5;
    color: var(--text-primary);
    font-weight: 500;
}

.sort-item:not(.active):hover {
    color: var(--text-secondary);
}

.sort-item:active {
    transform: scale(0.95);
}

/* ==================== 瀑布流布局 ==================== */
.waterfall {
    column-count: 2;
    column-gap: 6px;
    padding: 6px;
    /* 性能优化：限制布局影响范围 */
    contain: layout;
}

@media (min-width: 600px) {
    .waterfall {
        column-count: 3;
        column-gap: 10px;
        padding: 10px;
    }
}

@media (min-width: 900px) {
    .waterfall {
        column-count: 4;
    }
}

@media (min-width: 1200px) {
    .waterfall {
        column-count: 5;
    }
}

/* ==================== 帖子卡片 ==================== */
.card {
    break-inside: avoid;
    margin-bottom: 6px;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: none;
    cursor: pointer;
    transition: transform 0.15s;
    /* 性能优化：硬件加速 + 限制影响范围 */
    will-change: transform;
    contain: layout paint;
}

@media (min-width: 600px) {
    .card {
        margin-bottom: 10px;
    }
}

.card:active {
    transform: scale(0.98);
}

.card-cover {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--bg);
}

.card-cover-img-wrap {
    position: relative;
    width: 100%;
    display: block;
    overflow: hidden;
}

.card-cover-img-wrap img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.2s ease;
}

.card-cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1;
}

.video-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.video-play-icon svg {
    fill: #fff;
    margin-left: 3px;
}

.card-body {
    padding: 8px 10px 10px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card-author {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.card-author-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg);
}

.card-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-author-name {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-likes {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.card-likes svg {
    width: 12px;
    height: 12px;
}

.card-likes.liked svg {
    fill: var(--danger);
}

.card-likes.liked {
    color: var(--danger);
}

/* 点赞弹跳动画 */
@keyframes likeBounce {
    0% { transform: scale(0.9); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.0); }
}

.card-likes.like-bounce svg {
    animation: likeBounce 0.3s ease;
}

/* ==================== 底部导航栏 ==================== */
.xzs-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-h);
    background: #fff;
    border-top: 0.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 100%;
    color: #999;
    font-size: 10px;
    transition: color 0.2s, transform 0.2s;
}

.nav-item.active {
    color: #ff2442;
    transform: scale(1.05);
}

.nav-post {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    margin: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-post svg {
    width: 24px;
    height: 24px;
}

@media (min-width: 769px) {
    .xzs-bottom-nav {
        position: fixed !important;
        left: 50% !important;
        right: auto !important;
        bottom: 18px !important;
        transform: translateX(-50%) !important;
        width: min(520px, calc(100vw - 48px)) !important;
        height: 58px !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 2600 !important;
        border-radius: 999px !important;
        border: 1px solid rgba(255,36,66,.12) !important;
        box-shadow: 0 18px 50px rgba(15,23,42,.18) !important;
        overflow: hidden !important;
        padding-bottom: 0 !important;
    }
    .app {
        padding-bottom: 90px !important;
    }
}

/* ==================== 模态弹窗通用 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-box {
    background: #fff;
    border-radius: var(--radius-lg);
    position: relative;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-tertiary);
    z-index: 10;
    background: rgba(255, 255, 255, 0.8);
}

.modal-close:active {
    background: var(--bg);
}

.modal-close-fixed {
    position: fixed;
    top: 12px;
    right: 12px;
}

.modal-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header-bar h2 {
    font-size: 17px;
    font-weight: 600;
}

.modal-header-bar .modal-close {
    position: static;
    background: none;
}

.btn-publish {
    color: var(--primary);
    font-size: 15px;
    font-weight: 600;
    padding: 4px 8px;
}

.btn-publish:active {
    opacity: 0.6;
}

/* ==================== 登录注册弹窗 ==================== */
.auth-box {
    width: min(88vw, 340px);
    max-width: 340px;
    padding: 24px 24px 20px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 18px;
}
.xzs-auth-notice{margin:0 0 16px;padding:12px 14px;border-radius:16px;background:linear-gradient(135deg,rgba(255,36,66,.10),rgba(255,168,53,.14));border:1px solid rgba(255,36,66,.18);color:#a11428;font-size:13px;line-height:1.55;font-weight:800}

.auth-logo {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
}

.auth-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-box .modal-close {
    top: 8px;
    right: 8px;
}

.auth-form .input-group {
    margin-bottom: 12px;
}

.auth-form .input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.auth-form .input-group input {
    width: 100%;
    height: 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.auth-form .input-group input:focus {
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    height: 40px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    margin-top: 6px;
    transition: background 0.2s;
}

.btn-primary:active {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    opacity: 0.6;
}

.auth-switch {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.auth-switch a {
    font-weight: 600;
}

/* ==================== 发帖编辑器 ==================== */
.post-editor-box {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
}

@media (min-width: 769px) {
    .post-editor-box {
        max-width: 720px;
        height: 90vh;
        border-radius: var(--radius-lg);
    }
}

.post-editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 图片预览横向滚动 */
.post-editor-body .media-preview-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.post-editor-body .media-preview-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.post-editor-body .media-preview-item {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
}

.type-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.type-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.type-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

.media-upload-area {
    margin-bottom: 16px;
}

.upload-placeholder {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: border-color 0.2s;
}

.upload-placeholder:active {
    border-color: var(--primary);
}

.upload-placeholder svg {
    margin-bottom: 8px;
}

.upload-placeholder p {
    font-size: 13px;
}

.media-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.media-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
}

.media-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview-item .video-preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
}

.media-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.media-preview-item .remove-btn svg {
    fill: #fff;
}

.media-preview-item .video-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    z-index: 3;
}

/* 压缩进度 */
.compress-progress {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
}

.compress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--primary);
}

.progress-bar-track {
    height: 6px;
    background: rgba(255, 36, 66, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s;
}

.post-editor-body .input-group {
    margin-bottom: 14px;
}

.post-title-input {
    width: 100%;
    font-size: 18px;
    font-weight: 600;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.post-editor-body textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 0;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
}

.post-editor-body .input-group input {
    width: 100%;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.switch-row span {
    font-size: 15px;
    color: var(--text-primary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 24px;
    transition: 0.3s;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.switch input:checked + .switch-slider {
    background: var(--primary);
}

.switch input:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* ==================== 帖子详情 ==================== */
#postDetailModal {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    background: #f6f3ee;
}
.post-detail-box {
    width: 100vw;
    max-width: none;
    height: 100vh;
    background: #fff;
    border-radius: 0;
    overflow: hidden;
}

.post-detail-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 桌面端：左右分栏（左 60% 图片，右 40% 内容） */
@media (min-width: 769px) {
    .post-detail-box {
        display: flex;
        flex-direction: row;
    }

    .post-detail-body {
        display: flex;
        flex-direction: row;
        overflow: hidden;
        flex: 1;
    }

    .detail-media-section {
        flex: 0 0 60%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #000;
        overflow: hidden;
    }

    .detail-right-panel {
        flex: 0 0 40%;
        display: flex;
        flex-direction: column;
        background: #fff;
        overflow: hidden;
        border-left: 1px solid var(--border);
    }

    .detail-right-scroll {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .detail-image-wrap img,
    .detail-video-wrap video,
    .custom-video-player video {
        max-height: 90vh;
    }
}

.detail-media-section {
    position: relative;
    background: #000;
}

.detail-image-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.detail-image-wrap img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 70vh;
    object-fit: contain;
}

.detail-image-protect-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 5;
}

.detail-video-wrap {
    position: relative;
    width: 100%;
    max-height: 70vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-video-wrap video {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

/* ==================== 自定义视频播放器（小红书风格） ==================== */
.custom-video-player {
    position: relative;
    width: 100%;
    max-height: 70vh;
    background: #000;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.custom-video-player video {
    width: 100%;
    max-height: 70vh;
    display: block;
    object-fit: contain;
    background: #000;
}

/* 中央播放遮罩（点击区） */
.cvp-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.cvp-big-play {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    pointer-events: none;
}

.cvp-big-play svg {
    margin-left: 4px;
}

.custom-video-player.playing .cvp-big-play {
    display: none;
}

/* 底部控制栏 */
.cvp-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 14px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 3;
    opacity: 1;
    transition: opacity 0.25s ease;
    pointer-events: auto;
}

/* 播放中且鼠标未活动时隐藏控件 */
.custom-video-player.playing:not(.cvp-controls-visible) .cvp-controls {
    opacity: 0;
    pointer-events: none;
}

.custom-video-player.playing:not(.cvp-controls-visible) {
    cursor: none;
}

/* 进度条容器 */
.cvp-progress-wrap {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 4px;
}

.cvp-progress-bg,
.cvp-progress-buffered,
.cvp-progress-played {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    border-radius: 3px;
    transition: height 0.15s ease;
}

.cvp-progress-bg {
    width: 100%;
    background: rgba(255, 255, 255, 0.25);
}

.cvp-progress-buffered {
    width: 0%;
    background: rgba(255, 255, 255, 0.4);
}

.cvp-progress-played {
    width: 0%;
    background: #ff2442;
}

.cvp-progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.cvp-progress-wrap:hover .cvp-progress-bg,
.cvp-progress-wrap:hover .cvp-progress-buffered,
.cvp-progress-wrap:hover .cvp-progress-played {
    height: 5px;
}

.cvp-progress-wrap:hover .cvp-progress-handle {
    transform: translate(-50%, -50%) scale(1);
}

/* 按钮行 */
.cvp-btn-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cvp-btn {
    background: transparent;
    border: none;
    color: #fff;
    padding: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.cvp-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cvp-time {
    color: #fff;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.cvp-right-btns {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 音量控制 */
.cvp-volume-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.cvp-volume-slider {
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease;
    display: flex;
    align-items: center;
    padding-left: 0;
}

.cvp-volume-wrap:hover .cvp-volume-slider {
    width: 70px;
    padding-left: 4px;
}

.cvp-volume-track {
    position: relative;
    width: 60px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.cvp-volume-track::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.cvp-volume-fill {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    width: 100%;
    background: #fff;
    border-radius: 3px;
    pointer-events: none;
}

.cvp-volume-knob {
    position: absolute;
    top: 50%;
    left: 100%;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* 全屏时的样式 */
.custom-video-player:fullscreen {
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-video-player:fullscreen video {
    max-height: 100vh;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.custom-video-player:-webkit-full-screen {
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
}

.custom-video-player:-webkit-full-screen video {
    max-height: 100vh;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 移动端适配 */
@media (max-width: 640px) {
    .cvp-volume-wrap:hover .cvp-volume-slider {
        width: 0;
        padding-left: 0;
    }
    .cvp-big-play {
        width: 60px;
        height: 60px;
    }
    .cvp-controls {
        padding: 6px 10px 10px;
    }
}

.detail-image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    cursor: pointer;
}

.detail-image-nav svg {
    fill: #fff;
}

.detail-image-nav.prev {
    left: 12px;
}

.detail-image-nav.next {
    right: 12px;
}

.detail-image-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 6;
}

.detail-image-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.2s;
}

.detail-image-dot.active {
    background: #fff;
    width: 18px;
    border-radius: 3px;
}

.detail-content-section {
    padding: 16px;
}

.detail-author-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.detail-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    background: var(--bg);
}

.detail-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-author-info {
    flex: 1;
    min-width: 0;
}

.detail-author-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-author-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

.detail-follow-btn {
    padding: 5px 16px;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.detail-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.detail-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 12px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-tag {
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
}

.detail-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-tertiary);
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 16px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* 评论区 */
.comments-section {
    padding: 0 16px 16px;
}

.comments-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.comment-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg);
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.comment-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    word-break: break-word;
}

.comment-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.comments-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.no-comments {
    text-align: center;
    padding: 20px;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* 底部互动栏 */
.detail-actions {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    background: #fff;
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
}

.comment-input-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-input-bar input {
    flex: 1;
    height: 38px;
    background: var(--bg);
    border-radius: 19px;
    padding: 0 16px;
    font-size: 14px;
}

.comment-send-btn {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.comment-send-btn svg {
    fill: #fff;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.action-buttons::-webkit-scrollbar { display: none; }

.action-btn {
    flex: 0 0 auto;
    min-width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: 18px;
    transition: color 0.2s;
}

.action-btn svg {
    width: 22px;
    height: 22px;
    fill: var(--text-secondary);
}

.action-btn.active {
    color: var(--primary);
}

.action-btn.active svg {
    fill: var(--primary);
}

.action-btn.liked svg {
    fill: var(--danger);
}

.action-btn.liked {
    color: var(--danger);
}

.action-btn.collected svg {
    fill: var(--warning);
}

.action-btn.collected {
    color: var(--warning);
}

/* ==================== 举报弹窗 ==================== */
.report-box {
    width: 90%;
    max-width: 420px;
}

.report-body {
    padding: 16px;
    overflow-y: auto;
}

.report-hint {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.report-reasons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.reason-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.reason-item:active {
    background: var(--bg);
}

.reason-item input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.reason-item span {
    font-size: 15px;
}

.report-body .input-group textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 14px;
    resize: none;
}

.report-body .input-group textarea:focus {
    border-color: var(--primary);
}

/* ==================== 编辑资料 ==================== */
.edit-profile-box {
    width: 90%;
    max-width: 420px;
}

.edit-profile-body {
    padding: 20px 16px;
    overflow-y: auto;
}

.avatar-edit-area {
    text-align: center;
    margin-bottom: 20px;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 8px;
    overflow: hidden;
    background: var(--bg);
    border: 3px solid var(--primary-bg);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-file-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
#avatarInput {
    display: inline-block;
    max-width: 100%;
    font-size: 14px;
}

.edit-profile-body .input-group {
    margin-bottom: 16px;
}

.edit-profile-body .input-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.edit-profile-body .input-group input,
.edit-profile-body .input-group textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.edit-profile-body .input-group input:focus,
.edit-profile-body .input-group textarea:focus {
    border-color: var(--primary);
}

.edit-profile-body .input-group textarea {
    resize: none;
}

/* ==================== 用户主页 ==================== */
.search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 0.5px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-primary);
}

.back-btn:active {
    background: var(--bg);
}

.search-header h2 {
    font-size: 17px;
    font-weight: 600;
}

/* 移动端搜索视图内的搜索输入框 */
.search-view-input-wrap {
    display: none;
    flex: 1;
    align-items: center;
    gap: 8px;
}

.search-view-input-wrap .search-box {
    flex: 1;
    height: 34px;
    background: #f5f5f5;
    border-radius: 17px;
}

.search-view-input-wrap .search-box input {
    font-size: 14px;
}

.search-view-btn {
    flex-shrink: 0;
    font-size: 14px;
    color: var(--text-primary);
    padding: 4px 6px;
    font-weight: 500;
}

.search-view-btn:active {
    color: var(--primary);
}

.search-header-title {
    font-size: 17px;
    font-weight: 600;
}

/* 移动端：显示内嵌搜索框，隐藏标题；桌面端相反 */
@media (max-width: 768px) {
    .search-view-input-wrap {
        display: flex;
    }
    .search-header-title {
        display: none;
    }
}

.search-info {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.profile-header {
    background: #fff;
    padding: 20px 16px;
    text-align: center;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 12px;
    overflow: hidden;
    background: var(--bg);
    border: 3px solid var(--primary-bg);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-nickname {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.profile-bio {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.profile-stat {
    text-align: center;
}

.profile-stat-num {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.user-follow-btn {
    display: block;
    margin: 0 auto 16px;
    padding: 8px 32px;
    border: none;
    border-radius: 20px;
    background: #ff2442;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.user-follow-btn:active { transform: scale(0.95); }
.user-follow-btn.followed {
    background: #f0f0f0;
    color: #666;
}

.profile-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.profile-btn {
    padding: 7px 20px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.profile-btn.edit {
    background: var(--primary);
    color: #fff;
}

.profile-btn.logout {
    background: var(--bg);
    color: var(--text-secondary);
}

.profile-btn:active {
    opacity: 0.7;
}

.user-tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.user-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.user-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ==================== 图片浏览弹窗 ==================== */
.image-viewer-overlay {
    background: rgba(0, 0, 0, 0.95);
}

.image-viewer-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 210;
    cursor: pointer;
}

.image-viewer-container {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.image-viewer-container::-webkit-scrollbar {
    display: none;
}

.image-viewer-item {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    position: relative;
}

.image-viewer-item img {
    max-width: 95%;
    max-height: 90%;
    object-fit: contain;
}

.image-viewer-item .protect-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1;
}

.image-viewer-indicator {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    z-index: 210;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 14px;
    border-radius: 16px;
}

/* ==================== 加载与提示 ==================== */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 36, 66, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.5s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.no-more {
    text-align: center;
    padding: 16px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
    background: transparent;
    border: none;
}

.empty-state svg {
    opacity: 0.5;
    margin-bottom: 8px;
}

.empty-state p {
    margin-top: 8px;
    font-size: 13px;
    color: #999;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    max-width: 280px;
    text-align: center;
    animation: toastIn 0.25s ease, toastOut 0.25s ease 1.5s forwards;
    pointer-events: auto;
}

.toast.success {
    background: rgba(39, 174, 96, 0.9);
}

.toast.error {
    background: rgba(231, 76, 60, 0.9);
}

.toast.warning {
    background: rgba(243, 156, 18, 0.9);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* 全局加载 */
.global-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-loading-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.global-loading-box p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==================== PC端适配 ==================== */
@media (min-width: 769px) {
    .header-inner {
        padding: 0 20px;
    }

    .logo-text {
        font-size: 18px;
    }

    .search-box {
        height: 36px;
    }

    .search-box input {
        font-size: 14px;
    }

    .btn-post {
        padding: 6px 16px;
    }

    .avatar-wrap {
        width: 36px;
        height: 36px;
    }

    .card:active {
        transform: none;
    }

    .card:hover .card-cover-img-wrap img {
        transform: scale(1.02);
    }

    .view {
        padding: 0 20px 40px;
    }

    .sort-bar {
        border-radius: 0;
        margin: 0;
    }

    /* 桌面端隐藏移动端搜索按钮 */
    .header-search-btn {
        display: none;
    }

    /* 桌面端显示发布按钮文字和头像 */
    .header-right .avatar-wrap {
        display: block;
    }
}

/* ==================== 标签选择器 ==================== */
.tag-selector {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 12px;
}

.tag-selector-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tag-chip {
    padding: 5px 14px;
    border-radius: 14px;
    font-size: 12px;
    color: var(--text-secondary);
    background: #fff;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.tag-chip.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.tag-chip:not(.selected):hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.tag-custom-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.tag-custom-row input {
    flex: 1;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 13px;
    outline: none;
    background: #fff;
}

.tag-custom-row input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 36, 66, 0.15);
}

.tag-add-btn {
    padding: 6px 14px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.tag-add-btn:active {
    opacity: 0.7;
}

.tag-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 28px;
}

.tag-empty-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 28px;
}

.tag-selected-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.tag-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 36, 66, 0.15);
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
}

.tag-remove-btn:active {
    background: rgba(255, 36, 66, 0.3);
}

/* ==================== 自定义加载动画（紫书光环） ==================== */
.xzs-loader {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.xzs-loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2.5px solid transparent;
    animation: xzsRingSpin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.xzs-loader-ring:nth-child(1) {
    border-top-color: var(--brand-purple);
    animation-delay: 0s;
}

.xzs-loader-ring:nth-child(2) {
    width: 75%;
    height: 75%;
    border-right-color: #a29bfe;
    animation-delay: 0.2s;
    animation-direction: reverse;
}

.xzs-loader-ring:nth-child(3) {
    width: 50%;
    height: 50%;
    border-bottom-color: #a78bfa;
    animation-delay: 0.4s;
}

.xzs-loader-core {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-purple);
    animation: xzsCorePulse 1.5s ease-in-out infinite;
    z-index: 1;
}

@keyframes xzsRingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes xzsCorePulse {
    0%, 100% { transform: scale(0.8); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* ==================== 移动端微调 ==================== */
@media (max-width: 768px) {
    /* 移动端隐藏桌面搜索框 */
    .header-search-box {
        display: none;
    }

    /* 移动端显示中间tab栏 */
    .header-mobile-tabs {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;
    }

    .hm-tab {
        font-size: 15px;
        font-weight: 400;
        color: var(--text-tertiary);
        position: relative;
        padding: 4px 0;
        transition: color 0.2s, font-weight 0.2s;
    }

    .hm-tab.active {
        color: var(--text-primary);
        font-weight: 700;
    }

    .hm-tab.active::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 50%;
        transform: translateX(-50%);
        width: 20px;
        height: 2px;
        background: var(--primary);
        border-radius: 1px;
    }

    /* 移动端显示搜索图标按钮 */
    .header-search-btn {
        display: flex;
    }

    /* 移动端隐藏发布按钮和头像 */
    .btn-post {
        display: none;
    }

    .header-right .avatar-wrap {
        display: none;
    }

    /* 移动端隐藏桌面feed tab bar（用header里的tabs） */
    .feed-tab-bar {
        display: none;
    }

    .header-center {
        max-width: none;
    }

    .logo-text {
        display: none;
    }

    .post-detail-box {
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        max-width: 100%;
    }

    .post-detail-body {
        max-height: calc(100dvh - 112px - var(--keyboard-inset));
    }

    .detail-actions {
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0) + var(--keyboard-inset));
        transition: padding-bottom 0.18s ease;
    }

    .post-editor-box {
        height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }

    .modal-overlay {
        align-items: stretch;
    }

    .modal-box {
        border-radius: 0;
        max-height: 100vh;
    }

    .auth-box {
        align-self: center;
        width: min(90vw, 320px);
        max-width: 320px;
        max-height: calc(100dvh - 40px);
        border-radius: var(--radius-lg);
        padding: 22px 20px 18px;
    }

    .auth-header {
        margin-bottom: 16px;
    }

    .auth-logo {
        width: 36px;
        height: 36px;
    }

    .auth-header h2 {
        font-size: 19px;
    }
}

@media (max-width: 360px) {
    .auth-box {
        width: calc(100vw - 24px);
        padding: 20px 16px 16px;
    }

    .auth-form .input-group input,
    .btn-primary {
        height: 38px;
    }
}

/* 自定义视频播放器 */
.xzs-player {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    user-select: none;
}
.xzs-player video {
    width: 100%;
    display: block;
    cursor: pointer;
}
.xzs-player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s;
}
.xzs-player:hover .xzs-player-controls,
.xzs-player.show-controls .xzs-player-controls {
    opacity: 1;
}
.xzs-player-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}
.xzs-player-btn:hover {
    background: rgba(255,255,255,0.15);
}
.xzs-player-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.xzs-player-progress {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}
.xzs-player-progress-filled {
    height: 100%;
    background: #ff2442;
    border-radius: 2px;
    position: relative;
    transition: width 0.1s linear;
}
.xzs-player-progress-filled::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}
.xzs-player-progress:hover .xzs-player-progress-filled::after {
    opacity: 1;
}
.xzs-player-time {
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}
.xzs-player-volume {
    display: flex;
    align-items: center;
    gap: 4px;
}
.xzs-player-volume-slider {
    width: 60px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}
.xzs-player-volume-fill {
    height: 100%;
    background: #fff;
    border-radius: 2px;
}
.xzs-player-big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}
.xzs-player-big-play:hover {
    transform: translate(-50%, -50%) scale(1.1);
}
.xzs-player-big-play.hidden {
    opacity: 0;
    pointer-events: none;
}
.xzs-player-big-play svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
    margin-left: 3px;
}

/* 消息/私信系统 */
.msg-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 12px;
}
.msg-conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.msg-conversation-item:hover {
    background: var(--bg);
}
.msg-conversation-item .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.msg-conversation-info {
    flex: 1;
    min-width: 0;
}
.msg-conversation-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.msg-conversation-last {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.msg-conversation-time {
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}
.msg-unread-badge {
    width: 8px;
    height: 8px;
    background: #ff4757;
    border-radius: 50%;
    flex-shrink: 0;
}
/* 聊天界面 - 小红书风格 */
.view-chat {
    height: calc(100dvh - var(--header-h));
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-view {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 120px);
}
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 0.5px solid var(--border);
    background: #fff;
    flex-shrink: 0;
}
.chat-header .back-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}
.chat-header .back-btn:hover {
    background: #f5f5f5;
}
.chat-header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}
.chat-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.chat-header-avatar-group {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 14px;
}
.chat-header-info {
    flex: 1;
    min-width: 0;
}
.chat-header-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-header-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
    font-size: 14px;
}
.chat-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}
.conv-item-group {
    background: #fef7f7;
    border-bottom: 2px solid var(--primary-bg);
}
.conv-item-group:hover {
    background: #fff0f0;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f7f7f7;
}
.chat-msg-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.chat-msg-item.self {
    flex-direction: row;
    justify-content: flex-end;
}
.chat-msg-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}
.chat-msg-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.chat-msg-bubble-wrap {
    max-width: 65%;
}
.chat-msg-sender {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 3px;
    padding: 0 4px;
    font-weight: 500;
}
.chat-msg-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.chat-msg-item.other .chat-msg-bubble {
    background: #fff;
    color: #1a1a1a;
    border-top-left-radius: 4px;
}
.chat-msg-item.self .chat-msg-bubble {
    background: var(--primary);
    color: #fff;
    border-top-right-radius: 4px;
}
.chat-msg-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}
.chat-msg-item.self .chat-msg-time {
    text-align: right;
}
.chat-time-divider {
    text-align: center;
    font-size: 11px;
    color: #bbb;
    padding: 8px 0;
}
.chat-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.chat-bubble.sent {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-top-right-radius: 4px;
}
.chat-bubble.received {
    align-self: flex-start;
    background: var(--bg);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}
.chat-bubble-time {
    font-size: 10px;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
    text-align: right;
}
.chat-bubble.received .chat-bubble-time {
    color: var(--text-tertiary);
}
.chat-input-bar {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0) + var(--keyboard-inset));
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,.98);
    flex-shrink: 0;
    transition: padding-bottom 0.18s ease;
    box-sizing: border-box;
}
.chat-input-bar input {
    flex: 1 1 auto;
    min-width: 160px;
    width: auto;
    height: 60px;
    padding: 0 20px;
    border-radius: 26px;
    border: 1px solid var(--border);
    font-size: 16px;
    outline: none;
    background: var(--bg);
    box-sizing: border-box;
}
.chat-input-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 36, 66, 0.15);
}
.chat-send-btn {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    box-sizing: border-box;
}
.chat-send-btn:active {
    transform: scale(0.9);
}
.chat-send-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
/* 通知列表 */
.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: background 0.2s;
}
.notification-item:hover {
    background: var(--bg);
}
.notification-item.unread {
    background: rgba(255, 36, 66, 0.04);
}
.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.notification-content {
    flex: 1;
    min-width: 0;
}
.notification-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}
.notification-text strong {
    font-weight: 600;
}
.notification-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ==================== 消息页面 - 完整样式 ==================== */
.msg-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    padding: 12px 16px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.msg-tabs {
    display: flex;
    gap: 0;
}
.msg-tab {
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}
.msg-tab.active {
    color: var(--text-primary);
    font-weight: 600;
}
.msg-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: var(--primary);
}
.msg-tab-badge {
    font-size: 10px;
    background: var(--primary);
    color: #fff;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: top;
}
.mark-all-read-btn {
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s;
}
.mark-all-read-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-bg);
}

/* 会话列表 */
.conversation-list {
    padding: 0;
}
.conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.conv-item:hover {
    background: #fafafa;
}
.conv-item:active {
    background: #f0f0f0;
}
.conv-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}
.conv-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg);
}
/* 官方品牌图采用细边框与克制阴影；不影响普通用户头像和合作伙伴 Logo。 */
.conv-item-talk .conv-avatar img {
    border: 1px solid rgba(108, 92, 231, .22);
    border-radius: 12px;
    box-shadow: 0 3px 9px rgba(62, 49, 94, .12);
}
.conv-item-talk:focus-visible {
    outline: 2px solid var(--brand-purple);
    outline-offset: -2px;
}
.conv-avatar.group {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff2442 0%, #ff6b81 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}
.conv-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.conv-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.conv-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.conv-name-badge {
    display: inline-block;
    font-size: 10px;
    color: #fff;
    background: linear-gradient(135deg, #ff2442, #ff6b81);
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
    font-weight: 500;
}
.conv-time {
    font-size: 12px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}
.conv-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.conv-last-msg {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.conv-unread {
    flex-shrink: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    border-radius: 9px;
    text-align: center;
    font-weight: 500;
}

/* 通知列表 - 新版 */
.notification-list {
    padding: 0;
}
.notif-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.notif-item:hover {
    background: #fafafa;
}
.notif-item.unread {
    background: rgba(255, 36, 66, 0.03);
}
.notif-item.unread:hover {
    background: rgba(255, 36, 66, 0.06);
}
.notif-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}
.notif-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg);
}
.notif-type-icon {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.notif-type-icon svg {
    width: 14px;
    height: 14px;
}
.notif-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.notif-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.notif-sender {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.notif-time {
    font-size: 12px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}
.notif-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.notif-dot {
    position: absolute;
    top: 18px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
}
.notif-unfollow-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    padding: 4px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.notif-unfollow-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(255, 46, 99, 0.05);
}
.notif-unfollow-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* 空状态调整 */
.view-messages .empty-state,
.view-notifications .empty-state {
    padding: 80px 20px;
    color: var(--text-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}
.view-messages .empty-state p,
.view-notifications .empty-state p {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* 电脑端消息页优化 - 加宽容器、卡片化 */
@media (min-width: 769px) {
    .view-messages,
    .view-notifications {
        max-width: 720px;
        margin: 0 auto;
        padding: 20px;
    }
    .msg-header {
        border-radius: 12px 12px 0 0;
        border: 1px solid var(--border);
        border-bottom: none;
        padding-top: 16px;
    }
    .conversation-list,
    .notification-list {
        background: #fff;
        border: 1px solid var(--border);
        border-top: none;
        border-radius: 0 0 12px 12px;
        overflow: hidden;
    }
    .conv-item:last-child,
    .notif-item:last-child {
        border-bottom: none;
    }
    .conv-item,
    .notif-item {
        padding: 16px 20px;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .view-messages,
    .view-notifications {
        padding-bottom: 70px;
    }

    body.input-focused .xzs-bottom-nav,
    body.chat-open .xzs-bottom-nav,
    .view-chat.active ~ .xzs-bottom-nav {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    body.input-focused .view-chat {
        height: calc(100dvh - var(--header-h));
        padding-bottom: 0 !important;
    }
    .msg-header {
        padding: 10px 14px 0;
    }
    .msg-tab {
        padding: 10px 16px;
        font-size: 14px;
    }
    .conv-item,
    .notif-item {
        padding: 12px 14px;
    }
    .conv-avatar,
    .notif-avatar-wrap,
    .conv-avatar img,
    .notif-avatar {
        width: 44px;
        height: 44px;
    }
    .conv-avatar.group {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
    .mark-all-read-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}


/* ===== 小紫书纯文本通用封面模板 ===== */
.card-cover.text-cover {
    min-height: 210px;
    padding: 18px;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    color: #fff;
    background: #ff2442;
}

.card-cover.text-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 14%, rgba(255,255,255,.34), transparent 24%), radial-gradient(circle at 86% 78%, rgba(255,255,255,.22), transparent 26%);
    pointer-events: none;
}

.card-cover.text-cover::after {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 14px;
    pointer-events: none;
}

.text-cover-tag {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.22);
    backdrop-filter: blur(8px);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
}

.text-cover-title {
    position: relative;
    z-index: 1;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.22;
    letter-spacing: -.04em;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-cover-foot {
    position: relative;
    z-index: 1;
    font-size: 12px;
    font-weight: 800;
    opacity: .88;
}

.text-cover-red { background: linear-gradient(135deg, #ff2442, #ff6b81); }
.text-cover-blue { background: linear-gradient(135deg, #2f6bff, #5bc0ff); }
.text-cover-green { background: linear-gradient(135deg, #12b981, #6ee7b7); }
.text-cover-gold { background: linear-gradient(135deg, #b7791f, #f6c453); color: #3b2508; }
.text-cover-pink { background: linear-gradient(135deg, #ec4899, #f9a8d4); }
.text-cover-purple { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
.text-cover-ink { background: linear-gradient(135deg, #111827, #475569); }
.text-cover-sunset { background: linear-gradient(135deg, #f97316, #ef4444 55%, #7c3aed); }
.text-cover-mint { background: linear-gradient(135deg, #0f766e, #99f6e4); color: #063f3b; }
.text-cover-paper { background: linear-gradient(135deg, #fff7ed, #fde68a); color: #6b3f05; }
.text-cover-night { background: radial-gradient(circle at 20% 15%, #818cf8 0, transparent 28%), linear-gradient(135deg, #020617, #312e81); }
.text-cover-lilac { background: linear-gradient(135deg, #c084fc, #f0abfc); color: #3b0764; }

.text-cover-gold .text-cover-tag,
.text-cover-mint .text-cover-tag,
.text-cover-paper .text-cover-tag,
.text-cover-lilac .text-cover-tag {
    background: rgba(255,255,255,.42);
}

@media(max-width:480px){.card-cover.text-cover{min-height:185px}.text-cover-title{font-size:21px}}


/* ===== 昵称设置弹窗与视频画质选择 ===== */
.simple-nick-modal{position:fixed;inset:0;z-index:3000;background:rgba(15,23,42,.32);display:flex;align-items:center;justify-content:center;padding:20px}.nick-card{width:min(360px,calc(100vw - 40px));background:#fff;border-radius:22px;padding:24px;box-shadow:0 24px 70px rgba(15,23,42,.22)}.nick-card h3{font-size:20px;font-weight:800;margin:0 0 8px;color:#111827}.nick-card p{font-size:14px;color:#6b7280;line-height:1.7;margin:0 0 16px}.nick-actions{display:flex;gap:10px;margin-top:14px}.nick-actions button{flex:1;height:40px;border-radius:999px;font-weight:800}.btn-light{background:#f3f4f6;color:#374151}.cvp-quality-select{height:32px;border:0;border-radius:999px;padding:0 10px;background:rgba(0,0,0,.52);color:#fff;font-size:12px;font-weight:800;outline:none;backdrop-filter:blur(8px)}.cvp-quality-select option{background:#111;color:#fff}
@media(max-width:520px){.simple-nick-modal{align-items:flex-end;padding:12px}.nick-card{width:100%;border-radius:22px 22px 12px 12px}.nick-actions{flex-direction:column}.cvp-quality-select{max-width:128px}}


/* ===== 小紫书纯文本封面严格修复 2026080917 ===== */
.card-cover.text-cover{width:100%!important;min-height:0!important;height:auto!important;aspect-ratio:4/5!important;padding:16px!important;display:flex!important;flex-direction:column!important;justify-content:space-between!important;border-radius:18px 18px 0 0!important;overflow:hidden!important;background-size:cover!important}.card-cover.text-cover .text-cover-title{display:-webkit-box!important;-webkit-line-clamp:5!important;-webkit-box-orient:vertical!important;overflow:hidden!important;text-overflow:ellipsis!important;word-break:break-word!important;overflow-wrap:anywhere!important;max-height:none!important}.card-cover.text-cover .text-cover-tag,.card-cover.text-cover .text-cover-foot{flex:0 0 auto!important}.card-cover:not(.text-cover) .card-cover-img-wrap{aspect-ratio:4/5;background:#f3f4f6}.card-cover:not(.text-cover) .card-cover-img-wrap img{width:100%!important;height:100%!important;object-fit:cover!important}

/* 全屏详情页返回按钮 */
.detail-back-btn{position:fixed;top:max(14px,env(safe-area-inset-top));left:14px;right:auto;z-index:30;width:auto;height:42px;padding:0 14px 0 10px;border-radius:999px;display:inline-flex;align-items:center;gap:5px;background:rgba(255,255,255,.94);color:#111827;box-shadow:0 12px 30px rgba(15,23,42,.18);backdrop-filter:blur(14px)}.detail-back-btn span{font-size:14px;font-weight:800}@media(min-width:769px){.post-detail-box .detail-right-panel{max-width:520px}.post-detail-body:not(:has(.detail-media-section)){display:block;max-width:820px;margin:0 auto;padding-top:72px;background:#fff}.post-detail-body:not(:has(.detail-media-section)) .detail-right-panel{max-width:none;width:100%;border-left:0}}
@media(max-width:768px){.xzs-bottom-nav{position:fixed!important;left:0!important;right:0!important;bottom:0!important;display:flex!important;visibility:visible!important;opacity:1!important;z-index:2600!important;height:calc(var(--bottom-nav-h) + env(safe-area-inset-bottom,0))!important;padding-bottom:env(safe-area-inset-bottom,0)!important;transform:none!important}.app{padding-bottom:calc(var(--bottom-nav-h) + env(safe-area-inset-bottom,0))!important}}
.chat-ai-btn{width:42px;height:42px;min-width:42px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:999px;background:linear-gradient(135deg,#1515ff,#ff2bd6);color:#fff;font-size:12px;line-height:1;font-weight:950;letter-spacing:0;white-space:nowrap;box-shadow:0 8px 22px rgba(80,60,255,.28);box-sizing:border-box;overflow:hidden}.at-suggest{position:absolute;left:12px;right:80px;bottom:58px;max-height:188px;overflow:auto;padding:8px;border:1px solid rgba(255,36,66,.16);border-radius:16px;background:rgba(255,255,255,.98);box-shadow:0 18px 50px rgba(15,23,42,.18);z-index:60}.at-suggest button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border:0;border-radius:12px;background:#fff;text-align:left}.at-suggest button:hover{background:#fff1f3}.at-suggest b{font-size:13px;color:#111827}.at-suggest span{font-size:11px;color:#98a2b3}.flyz-ai-avatar{display:grid!important;place-items:center;border-radius:50%;background:radial-gradient(circle at 35% 25%,#fff,#38e8ff 26%,#5b35ff 62%,#111827);box-shadow:0 0 16px rgba(56,232,255,.72)}.flyz-ai-avatar span{color:#fff;font-size:19px;filter:drop-shadow(0 0 8px #fff)}.ai-msg .chat-msg-bubble{background:linear-gradient(135deg,#111827,#17345a 58%,#401f66)!important;color:#eaffff!important;border:1px solid rgba(56,232,255,.25)}@media(max-width:768px){.view-chat{height:calc(100dvh - var(--header-h) - var(--bottom-nav-h) - env(safe-area-inset-bottom,0))!important;padding-bottom:calc(var(--bottom-nav-h) + env(safe-area-inset-bottom,0))!important}.chat-view{height:100%!important}.chat-messages{padding-bottom:calc(18px + var(--bottom-nav-h) + env(safe-area-inset-bottom,0))!important}.chat-input-bar{position:sticky!important;bottom:calc(var(--bottom-nav-h) + env(safe-area-inset-bottom,0))!important;z-index:2200!important;padding-bottom:12px!important;box-shadow:0 -10px 26px rgba(15,23,42,.08)!important}.at-suggest{bottom:calc(58px + var(--bottom-nav-h) + env(safe-area-inset-bottom,0))!important}}


.comment-compose{display:flex;gap:10px;align-items:center;margin:10px 0 14px}
.comment-compose input{flex:1;min-width:0;height:44px;border:1px solid rgba(148,163,184,.35);border-radius:22px;padding:0 16px;font-size:16px;background:#fff;color:#111827}
.comment-compose button{flex:0 0 auto;height:44px;padding:0 18px;border:0;border-radius:22px;background:#ff2442;color:#fff;font-weight:800}
@media(max-width:640px){.comment-compose{position:relative;bottom:auto;z-index:1;background:#fff;padding:8px 0;margin:8px 0 12px}.comment-compose input{height:46px}.comment-compose button{height:46px}.comment-input-bar{display:none!important}.detail-actions{padding:6px 8px calc(6px + env(safe-area-inset-bottom,0));overflow:hidden}.action-buttons{max-width:100%;padding-bottom:2px}.action-btn{padding:6px 8px;font-size:12px}.action-btn svg{width:20px;height:20px}}


.user-badges{display:inline-flex;align-items:center;gap:5px;margin-left:6px;vertical-align:middle;flex-wrap:wrap}.user-badge{display:inline-flex;align-items:center;gap:3px;border:0;background:rgba(15,23,42,.06);border-radius:999px;padding:1px 6px;color:var(--badge-color,#64748b);font-size:11px;font-weight:800;line-height:18px;max-width:180px}.user-badge .badge-dot{display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;border-radius:50%;background:var(--badge-color,#64748b);color:#fff;font-size:10px}.user-badge .badge-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-badge.blue-v{background:rgba(22,131,255,.12);color:#1683ff}.user-badge.blue-v .badge-dot{background:#1683ff}.detail-author-name .user-badges,.profile-nickname .user-badges{margin-left:8px}.card-author-name+.user-badges{max-width:60%;overflow:hidden}@media(max-width:640px){.user-badges{gap:4px;margin-left:4px}.user-badge{font-size:10px;line-height:16px;padding:1px 5px;max-width:120px}.user-badge .badge-dot{min-width:14px;height:14px;font-size:9px}}

.video-preview-placeholder{width:100%;height:100%;min-height:96px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;background:linear-gradient(135deg,#111827,#334155);color:#fff;padding:10px;text-align:center;border-radius:inherit}.video-preview-placeholder span{max-width:100%;font-size:12px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.video-preview-placeholder small{font-size:11px;opacity:.75}

.dm-quick-start{display:flex;gap:8px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--border-light);background:#fff}.dm-quick-start input{flex:1;min-width:0;height:38px;border:1px solid var(--border-light);border-radius:999px;padding:0 14px;font-size:14px;background:#f8fafc}.dm-quick-start button{height:38px;border:0;border-radius:999px;padding:0 14px;background:var(--primary-color);color:#fff;font-weight:800}.user-action-row{display:flex;justify-content:center;gap:10px;align-items:center;flex-wrap:wrap;margin-top:12px}.user-follow-btn.dm{background:#fff;color:var(--primary-color);border:1px solid rgba(255,36,66,.35)}@media(max-width:640px){.dm-quick-start{padding:8px 10px;gap:6px}.dm-quick-start input{height:36px;font-size:13px}.dm-quick-start button{height:36px;padding:0 12px;font-size:13px}.user-action-row{gap:8px}}


/* 20260810 聊天多端适配补丁：不改整体UI，只修错版 */
.view-chat{height:calc(100dvh - var(--header-h));max-height:calc(100dvh - var(--header-h))}.chat-view{height:100%;min-height:0}.chat-body{min-height:0;overflow:hidden}.chat-messages{min-height:0;overscroll-behavior:contain}.chat-msg-item{max-width:100%;min-width:0}.chat-msg-bubble-wrap{min-width:0;max-width:min(72%,680px)}.chat-msg-bubble{overflow-wrap:anywhere;word-break:break-word}.chat-input-bar input{height:42px;min-width:0;font-size:15px}.at-suggest{max-width:calc(100vw - 24px)}@media(max-width:640px){.view-chat{position:fixed;left:0;right:0;top:var(--header-h);bottom:0;height:auto;max-height:none;background:#fff;z-index:60}.chat-header{padding:8px 10px}.chat-header-avatar,.chat-header-avatar-group{width:32px;height:32px}.chat-messages{padding:12px 8px 8px}.chat-msg-avatar,.chat-msg-avatar img{width:30px;height:30px}.chat-msg-bubble-wrap{max-width:78%}.chat-msg-bubble{font-size:14px;padding:9px 12px}.chat-input-bar{gap:6px;padding:8px 8px calc(8px + env(safe-area-inset-bottom,0) + var(--keyboard-inset))}.chat-input-bar input{height:40px;padding:0 14px;font-size:15px}.chat-send-btn{flex-basis:40px;width:40px;height:40px;min-width:40px}.chat-header-name{font-size:14px}.chat-header-meta{font-size:11px}}@media(min-width:900px){.chat-msg-bubble-wrap{max-width:58%}.chat-messages{padding-left:18px;padding-right:18px}}


/* 20260810 91ID大群贴底修复：进群默认最新消息，输入栏贴底，去掉底部空地 */
body.chat-open{overflow:hidden}.app:has(.view-chat[style*="flex"]){padding-bottom:0}.chat-open .xzs-bottom-nav{display:none!important}.chat-open .app{padding-bottom:0!important}.chat-open .main-content,.chat-open #xzsMain{padding-bottom:0!important;overflow:hidden!important}.view-chat{height:calc(100dvh - var(--header-h))!important;max-height:calc(100dvh - var(--header-h))!important;padding-bottom:0!important}.chat-body{flex:1 1 auto!important;min-height:0!important;overflow:hidden!important;background:#f7f7f7}.chat-messages{height:100%!important;flex:1 1 auto!important;overflow-y:auto!important;padding-bottom:12px!important;scroll-behavior:auto}.chat-input-bar{position:relative!important;bottom:auto!important;margin:0!important;transform:none!important;padding-bottom:calc(8px + env(safe-area-inset-bottom,0) + var(--keyboard-inset))!important}.chat-input-bar input{height:40px!important;min-height:40px!important}
@media(max-width:640px){.chat-open .view-chat{position:fixed!important;left:0!important;right:0!important;top:var(--header-h)!important;bottom:0!important;height:auto!important;max-height:none!important;z-index:2601!important}.chat-open .chat-header{min-height:48px}.chat-open .chat-body{height:auto!important}.chat-open .chat-messages{padding-bottom:8px!important}.chat-open .chat-input-bar{padding-top:7px!important;padding-bottom:calc(7px + env(safe-area-inset-bottom,0) + var(--keyboard-inset))!important}.chat-open .chat-send-btn{width:40px!important;height:40px!important;min-width:40px!important}.chat-open .chat-ai-btn{height:40px!important;min-width:40px!important}}
