/* ==================== 基础重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.5;
    min-height: 100vh;
}

/* ==================== 顶部导航栏 ==================== */
.wei-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.wei-header-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

.wei-header-btn:hover {
    background: #f0f0f0;
}

.wei-header-title {
    font-size: 17px;
    font-weight: 600;
    color: #111;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* ==================== 主内容区 ==================== */
.wei-main {
    padding-bottom: 40px;
}

/* ==================== 微语列表 ==================== */
.wei-list {
    max-width: 720px;
    margin: 0 auto;
    padding: 12px;
}

/* ==================== 微语卡片（朋友圈布局） ==================== */
.wei-moment {
    display: flex;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s;
}

.wei-moment:active {
    transform: scale(0.99);
}

.wei-moment-left {
    width: 42px;
    flex-shrink: 0;
    margin-right: 12px;
}

.wei-moment-left img {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
    background: #eee;
}

.wei-moment-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.wei-moment-header {
    margin-bottom: 6px;
}

.wei-moment-name {
    font-size: 15px;
    font-weight: 500;
    color: #576b95;
    text-decoration: none;
}

.wei-moment-content {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    word-break: break-word;
    margin-bottom: 10px;
}

/* 列表里的图片 */
.wei-moment-content img {
    border-radius: 6px;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 6px 0;
    background: #f0f0f0;
    max-width: 100%;
}

.wei-moment-content img.img-1 {
    width: 50%;
    height: auto;
    max-height: 240px;
}

.wei-moment-content img.img-2 {
    width: 40%;
    height: 140px;
    display: inline-block;
    margin-right: 6px;
    vertical-align: top;
}

.wei-moment-content img.img-3 {
    width: 29%;
    height: 120px;
    display: inline-block;
    margin-right: 6px;
    margin-bottom: 6px;
    vertical-align: top;
}

/* ==================== 视频：双层包裹，彻底治 Chrome 圆角失效 ==================== */
.video-mask {
    width: 50%;
    margin: 6px auto;
    border-radius: 8px;
    overflow: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.video-wrap {
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.video-wrap video {
    width: 100%;
    max-height: 260px;
    display: block;
    object-fit: cover;
}

/* 列表里的音频 */
.wei-moment-content audio {
    width: 60%;
    max-width: 100%;
    border-radius: 8px;
    display: block;
    margin: 6px auto;
}

/* ==================== 底部操作栏 ==================== */
.wei-moment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #f5f5f5;
    font-size: 13px;
    color: #999;
    margin-top: auto;
}

.wei-moment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #999;
}

.wei-moment-location {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #576b95;
}

.wei-moment-location svg {
    flex-shrink: 0;
}

.wei-moment-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wei-action-btn {
    background: none;
    border: none;
    font-size: 13px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.wei-action-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.wei-action-btn.liked {
    color: #e02020;
}

/* ==================== 加载提示 ==================== */
.wei-loading {
    text-align: center;
    padding: 20px 0;
    color: #999;
    font-size: 14px;
}

/* ==================== 到底提示 ==================== */
.wei-end-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0 30px;
    padding: 0 20px;
}

.wei-end-tip .wei-line {
    width: 60px;
    height: 1px;
    background-color: #ddd;
}

.wei-end-tip .wei-text {
    padding: 0 12px;
    font-size: 14px;
    color: #999;
}

/* ==================== 发布弹窗 ==================== */
.wei-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.wei-modal-overlay.active {
    display: flex;
}

.wei-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: modalIn 0.25s ease;
    position: relative;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.wei-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0;
}

.wei-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.wei-modal-close:hover {
    color: #333;
}

.wei-modal-body {
    padding: 20px;
}

.wei-textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
    min-height: 80px;
}

.wei-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ==================== 媒体区 ==================== */
.wei-media-area {
    margin-top: 12px;
}

.wei-media-preview {
    background: #f9fafb;
    border: 1px solid #eef1f4;
    border-radius: 10px;
    padding: 10px;
}

.wei-media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.wei-media-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    background: #eee;
}

.wei-media-preview audio {
    width: 60%;
    max-width: 100%;
    display: block;
    margin: 6px auto;
    border-radius: 8px;
}

/* 预览区视频同样双层包裹 */
.wei-media-preview .video-mask {
    width: 50%;
    margin: 6px auto;
    border-radius: 8px;
    overflow: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.wei-media-preview .video-wrap {
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.wei-media-preview .video-wrap video {
    width: 100%;
    max-height: 240px;
    display: block;
    object-fit: cover;
}

/* ==================== 媒体操作栏 ==================== */
.wei-media-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #f0f0f0;
}

.wei-media-add-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
    background: #fff;
    color: #666;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.wei-media-add-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.wei-media-hint {
    flex: 1;
    font-size: 12px;
    color: #999;
    cursor: pointer;
}

.wei-media-clear-btn {
    background: none;
    border: none;
    color: #e02020;
    font-size: 13px;
    cursor: pointer;
}

/* 媒体选择浮层 */
.wei-media-picker {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
}

.wei-media-pick {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.wei-media-pick:hover {
    background: #f3f4f6;
    color: #2563eb;
}

/* ==================== 位置 + 仅自己可见 ==================== */
.wei-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #f0f0f0;
    gap: 12px;
}

.wei-options-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.wei-location-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
    background: #fff;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.wei-location-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.wei-location-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wei-location-text {
    font-size: 13px;
    color: #576b95;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wei-location-clear-btn {
    background: none;
    border: none;
    color: #e02020;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
}

.wei-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ==================== 地址输入弹窗 ==================== */
.wei-url-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.wei-url-dialog-inner {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 360px;
}

.wei-url-dialog-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #111;
}

.wei-url-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
}

.wei-url-input:focus {
    border-color: #2563eb;
}

.wei-cover-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.wei-cover-input {
    flex: 1;
    min-width: 0;
}

.wei-cover-upload-btn {
    flex-shrink: 0;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid #2563eb;
    background: #fff;
    color: #2563eb;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    margin-top: 10px;
}

.wei-cover-upload-btn:hover {
    background: #2563eb;
    color: #fff;
}

.wei-cover-upload-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wei-url-dialog-btns {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: flex-end;
}

.wei-btn-cancel, .wei-btn-confirm {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.wei-btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.wei-btn-confirm {
    background: #2563eb;
    color: #fff;
}

/* ==================== 底部发布 ==================== */
.wei-publish-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.wei-credits-tip {
    font-size: 13px;
    color: #f59e0b;
}

.wei-submit-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.wei-submit-btn:hover {
    background: #1d4ed8;
}

.wei-submit-btn:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

/* ==================== 官方公告 ==================== */
.wei-announcement {
    background: #FFFDF5;
    border: 1px solid #FFD700;
    border-radius: 12px;
    padding: 16px;
    margin: 12px auto;
    width: calc(100% - 12px);
    max-width: calc(720px - 24px);
    position: relative;
}

.wei-announcement::before {
    content: "置顶";
    position: absolute;
    top: -1px;
    right: -1px;
    background-color: #FFD700;
    color: #FFF;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 0 12px 0 12px;
    z-index: 1;
}

.wei-announcement-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.wei-announcement-avatar {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.wei-announcement-title {
    font-size: 16px;
    font-weight: 600;
    color: #576b95;
}

.wei-announcement-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.wei-announcement-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f5f5f5;
}

.wei-announcement-time {
    font-size: 12px;
    color: #FF9900;
    font-weight: bold;
}

/* ==================== 顶部右侧按钮区 ==================== */
.wei-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.wei-signin-btn {
    font-size: 14px;
    color: #07C160;
    background: #fff;
    border: 1px solid #07C160;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    width: auto;
    flex-shrink: 0;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wei-signin-btn:hover {
    background: #07C160;
    color: #fff;
}

.wei-signin-btn.signed {
    background: #f0f0f0;
    color: #999;
    border-color: #ddd;
    cursor: not-allowed;
}

/* ==================== 图片放大浮层 ==================== */
.wei-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 20px;
}

.wei-lightbox.active {
    display: flex;
}

.wei-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 480px) {
    .wei-list {
        padding: 8px;
    }
    .wei-moment {
        padding: 14px;
        border-radius: 10px;
    }
    .video-mask {
        width: 80%;
    }
    .wei-media-preview .video-mask {
        width: 80%;
    }
    .wei-moment-content audio {
        width: 80%;
    }
    .wei-media-preview audio {
        width: 80%;
    }
}

/* ==================== 评论区（微语广场内嵌） ==================== */
.wei-comment-area {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #f0f0f0;
}
.wei-comment-list {
    font-size: 14px;
    margin-bottom: 10px;
}
.wei-comment-item {
    padding: 4px 0;
    line-height: 1.6;
}
.wei-comment-name {
    color: #576b95;
    font-weight: 500;
    margin-right: 6px;
}
.wei-comment-text {
    color: #333;
    word-break: break-word;
}
.wei-comment-empty {
    color: #999;
    font-size: 13px;
}
.wei-comment-input {
    display: flex;
    gap: 6px;
}
.wei-comment-input input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}
.wei-comment-input input:focus { border-color: #2563eb; }
.wei-comment-input button {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}
.wei-comment-more {
    display: inline-block;
    margin-top: 15px;
    font-size: 13px;
    color: #576b95;
    text-decoration: none;
}