/* ============================================
   📸 V36: 瞬间 (Moments) Stylesheet
   ============================================ */

/* Feed Header */
.moments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    gap: 10px;
}

.moments-sort-select {
    padding: 6px 12px;
    border: 1px solid #e0d4f5;
    border-radius: 16px;
    font-size: 12px;
    color: #666;
    background: #faf7ff;
    outline: none;
    cursor: pointer;
}

.moment-publish-btn {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

.moment-publish-btn:active {
    transform: scale(0.96);
    box-shadow: 0 1px 4px rgba(124, 58, 237, 0.2);
}

/* Moment Card */
.moment-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.06);
}

.moment-card-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.moment-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    flex-shrink: 0;
}

.moment-card-author-info {
    flex: 1;
    min-width: 0;
}

.moment-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.moment-card-name:hover {
    color: #7c3aed;
}

.moment-card-meta {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.moment-card-menu {
    font-size: 18px;
    color: #ccc;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.moment-card-menu:hover {
    color: #999;
}

/* Content */
.moment-card-content {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-break: break-word;
}

.moment-card-content.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.moment-expand-btn {
    color: #7c3aed;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 8px;
    display: inline-block;
}

/* Image Grid */
.moment-images {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
}

.moment-images.img-1 {
    grid-template-columns: 1fr;
}

.moment-images.img-2 {
    grid-template-columns: 1fr 1fr;
}

.moment-images.img-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.moment-images.img-4 {
    grid-template-columns: 1fr 1fr;
}

.moment-images.img-many {
    grid-template-columns: 1fr 1fr 1fr;
}

.moment-img-item {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.15s;
    background: #f5f0ff;
}

.moment-images.img-1 .moment-img-item {
    aspect-ratio: auto;
    max-height: 360px;
    border-radius: 8px;
}

.moment-img-item:hover {
    opacity: 0.9;
}

/* Video */
.moment-video {
    width: 100%;
    max-height: 360px;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #000;
}

/* Tags */
.moment-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.moment-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    background: linear-gradient(135deg, #f3e8ff, #ede9fe);
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.15);
}

/* Location */
.moment-location {
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Action Bar */
.moment-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 8px;
    border-top: 1px solid #f5f0ff;
}

.moment-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #999;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.15s;
    background: none;
    border: none;
}

.moment-action-btn:hover {
    color: #7c3aed;
}

.moment-action-btn.liked {
    color: #ef4444;
}

.moment-action-btn .action-icon {
    font-size: 16px;
}

/* Hot Comments */
.moment-hot-comments {
    margin-top: 8px;
    padding: 8px 10px;
    background: #faf7ff;
    border-radius: 8px;
}

.moment-hot-comment {
    font-size: 12px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 2px;
}

.moment-hot-comment .comment-author {
    font-weight: 600;
    color: #7c3aed;
    cursor: pointer;
}

/* MBTI Badge */
.moment-mbti-badge {
    display: inline-block;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: #ede9fe;
    color: #7c3aed;
    line-height: 16px;
}

/* Verify Badge */
.moment-verify-badge {
    display: inline-block;
    font-size: 10px;
    color: #10b981;
}

/* ============================================
   Composer Modal
   ============================================ */
.moment-composer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.moment-composer {
    background: #fff;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    animation: slideUp 0.3s;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.composer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f0eaf5;
}

.composer-header-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

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

.composer-submit-btn {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    border: none;
    padding: 6px 18px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.composer-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.composer-body {
    padding: 14px 16px;
}

.composer-textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    outline: none;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    resize: none;
    font-family: inherit;
}

.composer-textarea::placeholder {
    color: #ccc;
}

.composer-char-count {
    text-align: right;
    font-size: 11px;
    color: #ccc;
    margin-top: 4px;
}

.composer-char-count.near-limit {
    color: #ef4444;
}

/* Image Preview Grid */
.composer-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 12px;
}

.composer-img-wrapper {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f0ff;
}

.composer-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.composer-img-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
}

.composer-add-img {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px dashed #e0d4f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #b39ddb;
    font-size: 24px;
    transition: border-color 0.15s;
}

.composer-add-img:hover {
    border-color: #7c3aed;
}

.composer-add-img span {
    font-size: 11px;
    margin-top: 2px;
}

/* Composer Options */
.composer-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #f0eaf5;
    align-items: center;
}

.composer-option {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #888;
}

.composer-option input[type="text"] {
    padding: 4px 10px;
    border: 1px solid #e0d4f5;
    border-radius: 12px;
    font-size: 12px;
    outline: none;
    width: 120px;
}

.composer-option select {
    padding: 4px 8px;
    border: 1px solid #e0d4f5;
    border-radius: 12px;
    font-size: 12px;
    outline: none;
    background: white;
}

/* ============================================
   Image Gallery (Fullscreen)
   ============================================ */
.moment-gallery-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.moment-gallery-img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
}

.moment-gallery-close {
    position: fixed;
    top: 16px;
    right: 16px;
    color: white;
    font-size: 28px;
    cursor: pointer;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.3);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moment-gallery-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 36px;
    cursor: pointer;
    z-index: 10001;
    padding: 20px 10px;
    user-select: none;
    -webkit-user-select: none;
}

.moment-gallery-nav.prev { left: 8px; }
.moment-gallery-nav.next { right: 8px; }

.moment-gallery-counter {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    z-index: 10001;
}

/* ============================================
   Insight Card
   ============================================ */
.moment-insight-card {
    background: linear-gradient(135deg, #f8f4ff 0%, #ede9fe 100%);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(124, 58, 237, 0.12);
}

.moment-insight-header {
    font-size: 13px;
    font-weight: 600;
    color: #7c3aed;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.insight-vibe {
    display: inline-block;
    padding: 3px 12px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.insight-summary {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 12px;
}

.insight-lifestyle-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.insight-lifestyle-tag {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    background: white;
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

/* Radar Chart (CSS-based) */
.insight-radar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.insight-radar-item {
    flex: 1 1 45%;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #666;
}

.insight-radar-label {
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.insight-radar-bar {
    flex: 1;
    height: 6px;
    background: #e8e0f5;
    border-radius: 3px;
    overflow: hidden;
}

.insight-radar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #a855f7);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.insight-radar-value {
    width: 24px;
    text-align: left;
    font-weight: 600;
    color: #7c3aed;
    flex-shrink: 0;
}

/* ============================================
   Comment Panel (Bottom Sheet)
   ============================================ */
.moment-comment-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.moment-comment-panel {
    background: #fff;
    width: 100%;
    max-width: 500px;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s;
}

.comment-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f0eaf5;
    flex-shrink: 0;
}

.comment-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.comment-panel-close {
    font-size: 20px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.comment-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
}

.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.comment-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
}

.comment-item-body {
    flex: 1;
    min-width: 0;
}

.comment-item-name {
    font-size: 12px;
    font-weight: 600;
    color: #7c3aed;
    cursor: pointer;
}

.comment-item-text {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
    margin-top: 2px;
}

.comment-item-time {
    font-size: 10px;
    color: #bbb;
    margin-top: 4px;
}

.comment-item-reply-label {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin-bottom: 2px;
}

.comment-panel-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #f0eaf5;
    flex-shrink: 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
}

.comment-panel-input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #e0d4f5;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
}

.comment-panel-input:focus {
    border-color: #7c3aed;
}

.comment-panel-send {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.comment-panel-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Loading & Empty States
   ============================================ */
.moment-empty {
    text-align: center;
    padding: 40px 20px;
    color: #ccc;
}

.moment-empty-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.moment-empty-text {
    font-size: 14px;
}

.moment-loading-more {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: #bbb;
}
