/* public/assets/css/social/wechat-moments.css */

.wm-wrapper { padding: 32px 16px; position: relative; }
.wm-header { text-align: center; margin-bottom: 32px; }
.wm-title { font-size: 2.2rem; font-weight: 800; color: var(--text-main); margin-bottom: 12px; }
.wm-subtitle { font-size: 1.05rem; color: var(--text-muted); max-width: 700px; margin: 0 auto; line-height: 1.6; }

.wm-workspace { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 32px; align-items: center; }

/* ==========================================
   第一排：像素级还原预览区
   ========================================== */
.wm-preview-wrapper { width: 100%; box-sizing: border-box; display: flex; justify-content: center; background: url('data:image/svg+xml;utf8,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" fill="%23cbd5e1"/></svg>') repeat; background-color: #f1f5f9; border-radius: 16px; padding: 40px 20px; border: 1px solid var(--border-color); overflow-x: hidden; }
[data-theme="dark"] .wm-preview-wrapper { background-color: #0f172a; background-image: url('data:image/svg+xml;utf8,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" fill="%23334155"/></svg>'); }

/* 截图容器：强制固定宽度 500px */
.wm-capture-area { 
    width: 500px; min-width: 500px; 
    padding: 24px 20px; 
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    box-sizing: border-box; 
    transform-origin: top center;
    border: 1px solid transparent;
}

/* 🌟 微信主题色彩系统 */
.theme-light { background-color: #ffffff; color: #1a1a1a; }
.theme-light .wm-name { color: #576b95; }
.theme-light .wm-location { color: #576b95; }
.theme-light .wm-time-wrap, .theme-light .wm-delete { color: #b2b2b2; }
.theme-light .wm-interaction-box { background: #f3f3f5; }
.theme-light .wm-triangle { border-bottom-color: #f3f3f5; }
.theme-light .wm-likes-row { border-bottom-color: #e2e2e2; }
.theme-light .wm-likes-text, .theme-light .wm-cmt-name { color: #576b95; }
.theme-light .wm-heart-icon { color: #576b95; }

.theme-dark { background-color: #111111; color: #d1d1d1; border-color: #2a2a2a; }
.theme-dark .wm-name { color: #7b8fb9; }
.theme-dark .wm-location { color: #7b8fb9; }
.theme-dark .wm-time-wrap, .theme-dark .wm-delete { color: #555555; }
.theme-dark .wm-interaction-box { background: #1a1a1a; }
.theme-dark .wm-triangle { border-bottom-color: #1a1a1a; }
.theme-dark .wm-likes-row { border-bottom-color: #2a2a2a; }
.theme-dark .wm-likes-text, .theme-dark .wm-cmt-name { color: #7b8fb9; }
.theme-dark .wm-heart-icon { color: #7b8fb9; }


/* 布局框架 */
.wm-post-item { display: flex; gap: 12px; }
.wm-avatar-wrap { flex-shrink: 0; }
.wm-avatar { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #e2e8f0; }

.wm-content-wrap { flex: 1; min-width: 0; padding-top: 2px; }
.wm-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; letter-spacing: 0.5px; }
.wm-text { font-size: 15px; line-height: 1.5; word-wrap: break-word; white-space: pre-wrap; margin-bottom: 10px; }

/* 🌟 九宫格算法区 */
.wm-image-grid { display: grid; gap: 4px; margin-bottom: 12px; }
.wm-image-grid img { width: 100%; height: 100%; object-fit: cover; }
/* 1图 */
.wm-grid-1 { grid-template-columns: 1fr; width: 60%; }
.wm-grid-1 img { max-height: 300px; }
/* 2图、4图 (2列排版) */
.wm-grid-2, .wm-grid-4 { grid-template-columns: repeat(2, 1fr); width: 66%; aspect-ratio: 1/1 (for inner); }
.wm-grid-2 img, .wm-grid-4 img { aspect-ratio: 1/1; }
/* 3图、5-9图 (3列排版) */
.wm-grid-3, .wm-grid-multiple { grid-template-columns: repeat(3, 1fr); width: 100%; }
.wm-grid-3 img, .wm-grid-multiple img { aspect-ratio: 1/1; }

.wm-location { font-size: 12px; margin-bottom: 6px; font-weight: 500; }
.wm-meta-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 12px; }
.wm-time-wrap { display: flex; gap: 12px; }
.wm-action-btn { width: 32px; height: 22px; background: #f1f1f1; border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.theme-dark .wm-action-btn { background: #222; }
.wm-action-dots { color: #576b95; font-weight: bold; letter-spacing: 2px; line-height: 1; margin-top: -6px; margin-left: 2px; }

/* 互动区 (点赞与评论) */
.wm-interaction-box { position: relative; border-radius: 4px; font-size: 14px; line-height: 1.5; padding: 4px 0; }
.wm-triangle { position: absolute; top: -14px; left: 12px; width: 0; height: 0; border: 7px solid transparent; }
.wm-likes-row { display: flex; align-items: flex-start; gap: 6px; padding: 6px 10px; border-bottom: 1px solid; font-weight: 600; }
.wm-heart-icon { width: 15px; height: 15px; flex-shrink: 0; margin-top: 3px; }
.wm-likes-text { word-wrap: break-word; flex: 1; }

.wm-comments-list { display: flex; flex-direction: column; padding: 4px 10px; }
.wm-cmt-item { margin-bottom: 4px; word-wrap: break-word; }
.wm-cmt-name { font-weight: 600; }


/* ==========================================
   第二排：极客控制面板 (网格排列)
   ========================================== */
.wm-controls { width: 100%; box-sizing: border-box; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 16px; padding: 24px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px 24px; }

.control-section { display: flex; flex-direction: column; }
.control-section h4 { margin: 0 0 16px 0; font-size: 1rem; color: var(--text-main); border-bottom: 2px solid rgba(7, 193, 96, 0.2); padding-bottom: 8px; display: inline-block; width: fit-content; }

.input-group { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }
.input-group input, .input-group select, .input-group textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-body); color: var(--text-main); font-size: 0.95rem; outline: none; transition: 0.2s; box-sizing: border-box; }
.input-group input:focus, .input-group select:focus, .input-group textarea:focus { border-color: #07c160; }
.input-group textarea { resize: vertical; font-family: inherit; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn-text-sm { background: none; border: none; color: #ef4444; font-size: 0.8rem; cursor: pointer; text-align: left; padding: 0; font-weight: 600; }
.btn-text-sm:hover { text-decoration: underline; }

/* 消息构建器 */
.msg-builder { background: var(--bg-body); padding: 16px; border-radius: 12px; border: 1px dashed var(--border-color); display: flex; flex-direction: column; gap: 10px; }
.msg-input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main); box-sizing: border-box; }

.wm-btn-primary { background: #07c160; color: #fff; border: none; padding: 14px 20px; font-size: 1.05rem; font-weight: 800; border-radius: 12px; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 10px rgba(7, 193, 96, 0.3); width: 100%; }
.wm-btn-primary:hover { background: #06ad56; transform: translateY(-2px); }
.wm-btn-secondary { background: var(--bg-surface); color: #07c160; border: 1px solid #07c160; padding: 10px; font-weight: 700; border-radius: 8px; cursor: pointer; transition: 0.2s; }
.wm-btn-secondary:hover { background: rgba(7, 193, 96, 0.1); }

/* 列表项 */
.msg-list { flex: 1; max-height: 250px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 6px; }
.list-item { display: flex; align-items: center; justify-content: space-between; background: var(--bg-body); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-color); font-size: 0.9rem; }
.list-item span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-main); }
.list-item-del { color: #ef4444; cursor: pointer; font-size: 1.1rem; padding-left: 8px; user-select: none; }

.wm-info-card { background: var(--bg-surface); padding: 24px; border-radius: 16px; border: 1px solid var(--border-color); box-sizing: border-box; max-width: 1000px; margin: 0 auto; }

/* 📱 响应式 */
@media (max-width: 850px) {
    .wm-controls { grid-template-columns: 1fr; gap: 24px; }
    .wm-preview-wrapper { padding: 20px 10px; }
    .wm-capture-area { transform-origin: top center; }
}