/* public/assets/css/social/tiktok-maker.css */

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

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

/* ==========================================
   第一排：沉浸式预览区 (自适应高度)
   ========================================== */
.tk-preview-wrapper { width: 100%; 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; box-sizing: border-box; }
[data-theme="dark"] .tk-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>'); }

/* 🌟 移除定高，允许容器被图片撑开 */
.tk-capture-area { 
    width: 450px; min-width: 450px; 
    min-height: 550px; /* 保底最小高度，防止超宽图导致 UI 挤压 */
    position: relative; 
    background: #000; 
    color: #fff; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    overflow: hidden; 
    border-radius: 12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform-origin: top center;
    display: flex;
    flex-direction: column;
}

/* 🌟 图片回归文档流，利用其自带比例撑开父容器高度 */
.tk-bg-img { 
    display: block;
    width: 100%; 
    height: auto; 
    min-height: 550px; 
    object-fit: cover; 
    z-index: 1; 
    position: relative; 
}

/* 🌟 渐变遮罩改为固定高度 350px，永远只保护底部文字区 */
.tk-overlay-gradient { 
    position: absolute; 
    bottom: 0; left: 0; 
    width: 100%; 
    height: 350px; 
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%); 
    z-index: 2; 
    pointer-events: none; 
}

/* 顶部栏 */
.tk-top-bar { position: absolute; top: 20px; left: 0; width: 100%; display: flex; justify-content: center; gap: 20px; font-size: 16px; font-weight: 600; color: rgba(255,255,255,0.7); z-index: 3; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.top-tab.active { color: #fff; position: relative; }
.top-tab.active::after { content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); width: 24px; height: 3px; background: #fff; border-radius: 2px; }
.icon-search { position: absolute; right: 20px; width: 24px; height: 24px; color: #fff; }

/* 右侧操作栏 */
.tk-right-bar { position: absolute; bottom: 90px; right: 12px; display: flex; flex-direction: column; align-items: center; gap: 20px; z-index: 3; }
.tk-action { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.tk-action svg { width: 36px; height: 36px; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5)); }
.tk-action span { font-size: 13px; font-weight: 600; }

/* 头像挂件 */
.tk-profile { position: relative; margin-bottom: 8px; }
.avatar-ring { width: 48px; height: 48px; border-radius: 50%; border: 2px solid #fff; overflow: hidden; background: #333; }
.avatar-ring img { width: 100%; height: 100%; object-fit: cover; }
.follow-btn { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; background: #fe2c55; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: bold; border: 2px solid transparent; box-sizing: border-box; line-height: 1; }

/* 底部右侧音乐唱片 */
.tk-music-disc { margin-top: 16px; width: 48px; height: 48px; border-radius: 50%; background: #222; border: 8px solid #222; box-sizing: border-box; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.tk-music-disc img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* 底部视频信息 */
.tk-bottom-info { position: absolute; bottom: 20px; left: 16px; right: 80px; display: flex; flex-direction: column; gap: 8px; z-index: 3; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.tk-username { font-size: 17px; font-weight: 700; }
.tk-caption { font-size: 15px; line-height: 1.4; word-wrap: break-word; white-space: pre-wrap; }
.tk-link { font-weight: 700; color: #fff; } 
.tk-music-marquee { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; margin-top: 4px; }
.tk-music-marquee svg { width: 18px; height: 18px; }

/* ==========================================
   抖音 (国内版) 风格微调
   ========================================== */
.style-douyin .top-tab:first-child { display: none; }
.style-douyin .top-tab.active { font-size: 18px; }
.style-douyin .top-tab.active::after { background: #fa2c55; }
.style-douyin .tk-action svg { fill: rgba(255,255,255,0.9); }
.style-douyin .follow-btn { background: #fa2c55; }

/* ==========================================
   第二排：控制面板 (网格)
   ========================================== */
.tk-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.5fr; 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(254, 44, 85, 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[type="text"], .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[type="text"]:focus, .input-group select:focus, .input-group textarea:focus { border-color: #fe2c55; }
.input-group input[type="file"] { font-size: 0.85rem; color: var(--text-muted); padding-top: 4px; }
.input-group textarea { resize: vertical; font-family: inherit; }

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

.tk-btn-primary { background: #fe2c55; 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(254, 44, 85, 0.3); width: 100%; }
.tk-btn-primary:hover { background: #e0244b; transform: translateY(-2px); }

.tk-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: 800px) {
    .tk-controls { grid-template-columns: 1fr; gap: 24px; }
    .tk-preview-wrapper { padding: 20px 10px; }
}