/* public/assets/css/life/business-card.css */

#cardWrapper {
    --bc-theme-color: #2563eb; 
    --bc-text-dark: #1e293b;
    --bc-text-light: #64748b;
    --bc-bg-main: #ffffff;
}

/* =========================================================
   全局架构
   ========================================================= */
.bc-workspace { 
    display: flex; 
    align-items: flex-start; 
    gap: 30px; 
    width: 100%; 
    box-sizing: border-box;
}

.bc-sidebar-fixed { 
    width: 320px; 
    flex-shrink: 0;
    position: sticky; 
    top: 24px; 
    background: var(--bg-surface); 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-lg); 
    padding: 24px; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05); 
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    box-sizing: border-box;
}
.bc-sidebar-fixed::-webkit-scrollbar { width: 4px; }
.bc-sidebar-fixed::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

/* 废弃原有的移动端遮罩与悬浮元素，保持网页流式清爽 */
.bc-sidebar-close, .bc-mobile-overlay, .bc-mobile-bottom-nav { display: none !important; }

/* 核心容器：恢复 PC 端的 min-width 保护和上下留白 */
.bc-canvas-scroll { 
    flex: 1; 
    min-width: 0; /* ★ 极度关键：防止被子元素撑爆 Flex 布局 */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 10px; /* ★ 恢复了上下左右的优美留白 */
    box-sizing: border-box;
    background: repeating-conic-gradient(#f1f5f9 0 20px, transparent 20px 40px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden; 
}

.bc-card-scaler {
    width: 600px; 
    transform-origin: top center;
    /* margin-bottom 将由 JS 动态注入 */
}

/* =========================================================
   UI 控制台元素
   ========================================================= */
.bc-control-group { margin-bottom: 20px; }
.bc-control-group label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; }

.bc-color-picker { display: flex; gap: 12px; flex-wrap: wrap; }
.bc-color-dot { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.1);}
.bc-color-dot:hover { transform: scale(1.1); }
.bc-color-dot.active { border-color: var(--text-main); transform: scale(1.15); outline: 2px solid var(--bg-body); }

.bc-select, .bc-input-text { width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-body); color: var(--text-main); font-size: 0.95rem; font-weight: 600; cursor: pointer; outline: none; transition: 0.2s; box-sizing: border-box;}
.bc-input-text { font-family: monospace; font-weight: normal; cursor: text; }
.bc-select:focus, .bc-input-text:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 0, 102, 204), 0.1); }

.bc-switch-label { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 12px; }
.bc-switch-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary-color); cursor: pointer; }
.bc-switch-label span { font-size: 0.95rem; color: var(--text-main); font-weight: 500; }

.bc-btn-export { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--primary-color); color: white; padding: 16px; border: none; border-radius: 12px; font-size: 1.1rem; font-weight: 800; cursor: pointer; transition: 0.3s; box-shadow: 0 4px 10px rgba(var(--primary-rgb, 0, 102, 204), 0.3); box-sizing: border-box;}
.bc-btn-export:hover { opacity: 0.9; transform: translateY(-2px); }

/* =========================================================
   名片主体包装
   ========================================================= */
.bc-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 40px; 
    align-items: center;
    width: 100%;
}

.bc-card-face {
    width: 600px;
    height: 350px;
    flex-shrink: 0; 
    background: var(--bc-bg-main);
    border-radius: 16px;
    overflow: hidden;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--bc-text-dark);
    display: flex;
    flex-direction: row;
    box-sizing: border-box;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
}

/* ★ 核心防变形护盾：强制不换行，超长加入省略号(...)显得更优雅 */
.bc-editable { 
    outline: none; 
    border-bottom: 1px dashed transparent; 
    transition: 0.2s; 
    display: inline-block; 
    max-width: 100%; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; /* 文字超出时显示省略号 */
}
.bc-editable:hover { border-bottom: 1px dashed rgba(0,0,0,0.2); }
.bc-editable:focus { 
    border-bottom: 1px dashed var(--bc-theme-color); 
    background: rgba(0,0,0,0.03); 
    border-radius: 4px; 
    padding: 0 4px;
    white-space: normal; /* 获取焦点正在编辑时，允许换行显示全貌，方便编辑 */
    overflow: visible; 
    z-index: 10;
    position: relative;
}

/* ---------------------------------------------------------
   模板 1：Tech
   --------------------------------------------------------- */
.tpl-tech .bc-card-front { justify-content: center; align-items: center; background: linear-gradient(135deg, var(--bc-theme-color), #0f172a); color: #fff;}
.tpl-tech .bc-card-front .bc-front-inner { text-align: center; display: flex; flex-direction: column; align-items: center; max-width: 90%;}
.tpl-tech .bc-card-front h1 { font-size: 3.5rem; font-weight: 900; margin: 0; letter-spacing: 2px;}
.tpl-tech .bc-card-front h2 { font-size: 1.1rem; font-weight: 400; letter-spacing: 4px; color: rgba(255,255,255,0.7); margin-top: 10px; text-transform: uppercase;}

.tpl-tech .bc-card-brand { flex: 1.2; padding: 40px; background: linear-gradient(135deg, var(--bc-theme-color), rgba(255,255,255,0.1)); color: #fff; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.tpl-tech .bc-card-contact { flex: 1.5; padding: 40px 30px; display: flex; flex-direction: column; justify-content: center; gap: 20px; background: #fff; overflow: hidden;}
.tpl-tech .bc-brand-texts h2 { font-size: 1.8rem; font-weight: 900; margin: 0 0 5px 0; color: #fff;}
.tpl-tech .bc-brand-texts h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 15px 0; text-transform: uppercase; color: rgba(255,255,255,0.8); border-bottom: 2px solid rgba(255,255,255,0.3); padding-bottom: 15px;}
.tpl-tech .bc-brand-texts h4 { font-size: 0.95rem; font-weight: 800; margin: 0; color: rgba(255,255,255,0.9);}
.tpl-tech .bc-qr-box { align-self: flex-end; }

/* ---------------------------------------------------------
   模板 2：Corporate
   --------------------------------------------------------- */
.tpl-corp .bc-card-face { font-family: 'Georgia', serif; }
.tpl-corp .bc-card-front { background: var(--bc-theme-color); flex-direction: column; justify-content: center; align-items: center; color:#fff;}
.tpl-corp .bc-card-front .bc-front-inner { text-align: center; max-width: 90%; }
.tpl-corp .bc-card-front h1 { font-size: 3rem; font-weight: 700; margin: 0; }
.tpl-corp .bc-card-front h2 { font-size: 1.2rem; font-weight: 400; margin-top: 10px; font-style: italic; color: rgba(255,255,255,0.8);}

.tpl-corp .bc-card-brand { flex: 1.5; padding: 40px; background: #fff; display: flex; flex-direction: column; justify-content: center; overflow: hidden;}
.tpl-corp .bc-brand-texts h2 { font-size: 2.2rem; font-weight: 700; margin: 0 0 5px 0; color: var(--bc-theme-color);}
.tpl-corp .bc-brand-texts h3 { font-size: 1rem; font-weight: 400; margin: 0; color: var(--bc-text-light); font-style: italic;}
.tpl-corp .bc-brand-texts h4 { font-size: 0.95rem; font-weight: 700; margin: 15px 0 0 0; color: var(--bc-text-dark);}
.tpl-corp .bc-card-contact { flex: 1; padding: 40px 30px; background: #f8fafc; border-left: 1px solid #e2e8f0; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;}
.tpl-corp .bc-qr-box { align-self: center; }

/* ---------------------------------------------------------
   模板 3：Creative
   --------------------------------------------------------- */
.tpl-creative .bc-card-front { justify-content: center; align-items: center; background: #fff;}
.tpl-creative .bc-card-front .bc-front-inner { background: var(--bc-theme-color); color: #fff; padding: 40px; border-radius: 50%; width: 250px; height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-shadow: 0 20px 25px rgba(0,0,0,0.15); max-width: 90%;}
.tpl-creative .bc-card-front h1 { font-size: 2.5rem; font-weight: 900; margin: 0;}
.tpl-creative .bc-card-front h2 { font-size: 0.9rem; font-weight: 700; margin-top: 10px;}
.tpl-creative .boxAvatarFront { display: none !important; } 

.tpl-creative .bc-card-back { background: var(--bc-theme-color); color: #fff;}
.tpl-creative .bc-card-brand { flex: 1; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.tpl-creative .bc-brand-texts h2 { font-size: 2.2rem; font-weight: 900; margin: 0; color: #fff; line-height: 1.1;}
.tpl-creative .bc-brand-texts h3 { font-size: 1.1rem; font-weight: 600; margin: 10px 0; color: #fff;}
.tpl-creative .bc-brand-texts h4 { font-size: 1rem; font-weight: 800; margin: 0; color: rgba(255,255,255,0.7);}
.tpl-creative .bc-card-contact { flex: 1.2; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; background: #fff; color: var(--bc-text-dark); overflow: hidden;}
.tpl-creative .bc-c-icon { background: var(--bc-theme-color); color: #fff; }
.tpl-creative .bc-qr-box { align-self: flex-start; }

/* ---------------------------------------------------------
   模板 4：Minimalist
   --------------------------------------------------------- */
.tpl-minimal .bc-card-face { background: #ffffff; border: 1px solid #e2e8f0; font-family: 'Helvetica Neue', Arial, sans-serif;}
.tpl-minimal .bc-card-front { justify-content: center; align-items: center;}
.tpl-minimal .bc-card-front .bc-front-inner { text-align: center; display: flex; flex-direction: column; align-items: center; max-width: 90%;}
.tpl-minimal .bc-card-front h1 { font-size: 2.5rem; font-weight: 300; margin: 0; letter-spacing: 6px; color: var(--bc-text-dark);}
.tpl-minimal .bc-card-front h2 { font-size: 0.85rem; font-weight: 400; letter-spacing: 2px; color: var(--bc-theme-color); margin-top: 15px; text-transform: uppercase;}
.tpl-minimal .boxAvatarFront { border-radius: 0; border: none; box-shadow: none; border-bottom: 2px solid var(--bc-theme-color); padding-bottom: 10px; margin-bottom: 20px;}

.tpl-minimal .bc-card-brand { flex: 1; padding: 40px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.tpl-minimal .bc-brand-texts h2 { font-size: 1.8rem; font-weight: 300; margin: 0 0 5px 0; color: var(--bc-text-dark); letter-spacing: 2px;}
.tpl-minimal .bc-brand-texts h3 { font-size: 0.9rem; font-weight: 600; margin: 0 0 15px 0; text-transform: uppercase; color: var(--bc-theme-color); letter-spacing: 1px;}
.tpl-minimal .bc-brand-texts h4 { font-size: 0.85rem; font-weight: 400; margin: 0; color: var(--bc-text-light);}
.tpl-minimal .bc-card-contact { flex: 1.2; padding: 40px 30px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 20px; overflow: hidden;}
.tpl-minimal .bc-contact-list li { justify-content: flex-end; }
.tpl-minimal .bc-c-icon { display: none; } 
.tpl-minimal .boxAvatarBack { display: none !important; }

/* ---------------------------------------------------------
   模板 5：Real Estate
   --------------------------------------------------------- */
.tpl-realestate .bc-card-face { background: #f8fafc; flex-direction: column; }
.tpl-realestate .bc-card-front { justify-content: center; align-items: center; background: #0f172a; border-bottom: 12px solid var(--bc-theme-color);}
.tpl-realestate .bc-card-front .bc-front-inner { text-align: center; display: flex; flex-direction: column; align-items: center; max-width: 90%;}
.tpl-realestate .bc-card-front h1 { font-size: 3rem; font-weight: 800; margin: 0; color: #fff;}
.tpl-realestate .bc-card-front h2 { font-size: 1rem; font-weight: 600; color: var(--bc-theme-color); margin-top: 5px; text-transform: uppercase;}
.tpl-realestate .boxAvatarFront { border-radius: 8px; border: 2px solid var(--bc-theme-color);}

.tpl-realestate .bc-card-brand { padding: 30px 40px 10px 40px; display: flex; align-items: center; gap: 20px; overflow: hidden;}
.tpl-realestate .bc-brand-texts { flex: 1; overflow: hidden; }
.tpl-realestate .bc-brand-texts h2 { font-size: 1.6rem; font-weight: 800; margin: 0; color: var(--bc-text-dark);}
.tpl-realestate .bc-brand-texts h3 { font-size: 0.95rem; font-weight: 600; margin: 4px 0; color: var(--bc-theme-color); text-transform: uppercase;}
.tpl-realestate .bc-brand-texts h4 { font-size: 0.9rem; font-weight: 700; margin: 0; color: var(--bc-text-light);}
.tpl-realestate .boxAvatarBack { border-radius: 8px; margin-bottom: 0;}
.tpl-realestate .bc-card-contact { padding: 15px 40px; background: #0f172a; color: #fff; flex: 1; display: flex; flex-direction: row; justify-content: space-between; align-items: center; border-top: 4px solid var(--bc-theme-color); overflow: hidden;}
.tpl-realestate .bc-c-icon { background: transparent; color: var(--bc-theme-color); }
.tpl-realestate .bc-qr-box { padding: 4px; border-radius: 4px; }

/* 通用组件 */
.bc-contact-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 0.9rem; font-weight: 500; width: 100%;}
.bc-contact-list li { display: flex; align-items: center; gap: 10px; width: 100%; overflow: hidden;}
.bc-c-icon { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,0.04); color: var(--bc-theme-color); flex-shrink: 0;}
.bc-c-icon svg { width: 14px; height: 14px; }

.bc-avatar-box { position: relative; width: 80px; height: 80px; border-radius: 50%; border: 3px solid #fff; overflow: hidden; background: #fff; margin-bottom: 20px; flex-shrink: 0; box-shadow: 0 4px 6px rgba(0,0,0,0.1);}
.bc-avatar-box img { width: 100%; height: 100%; object-fit: cover; }
.bc-avatar-upload { position: absolute; inset: 0; background: rgba(0,0,0,0.5); color: #fff; font-size: 0.8rem; font-weight: bold; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: 0.2s;}
.bc-avatar-box:hover .bc-avatar-upload { opacity: 1; }
.bc-avatar-upload label { cursor: pointer; }

.bc-qr-box { background: #fff; padding: 6px; border-radius: 8px; border: 1px solid #e2e8f0; display: inline-block; flex-shrink: 0;}
#qrcodeRender img, #qrcodeRender canvas { display: block; width: 80px; height: 80px; }

[data-theme="dark"] .bc-sidebar-fixed { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .bc-select, [data-theme="dark"] .bc-input-text { background: #1e293b; border-color: #334155; color: #f8fafc;}
[data-theme="dark"] .bc-canvas-scroll { background: repeating-conic-gradient(#1e293b 0 20px, #0f172a 20px 40px); border-color: #334155;}

/* =========================================================
   SEO 内容强化网格
   ========================================================= */
.tool-seo-content { margin-top: 50px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 40px; }
.tool-seo-content h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 20px; color: var(--text-main); }
.seo-intro-section { margin-bottom: 40px; }
.seo-lead-text { font-size: 1rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 15px;}
.seo-sub-heading { font-size: 1.4rem; font-weight: 700; margin-bottom: 20px; color: var(--text-main); border-left: 4px solid var(--primary-color); padding-left: 12px;}

.seo-feature-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.seo-feature-card { background: var(--bg-body); border: 1px solid var(--border-color); padding: 24px; border-radius: 12px; transition: all 0.3s ease; display: flex; flex-direction: column; align-items: flex-start;}
.seo-feature-card:hover { border-color: var(--primary-color); transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0, 102, 204, 0.08); }

.seo-feature-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; width: 100%; }
.seo-icon { width: 40px; height: 40px; flex-shrink: 0; color: var(--primary-color); background: rgba(var(--primary-rgb, 0, 102, 204), 0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.seo-icon svg { width: 20px; height: 20px; }
.seo-feature-card h3 { font-size: 1.1rem; font-weight: 700; margin: 0; color: var(--text-main); }
.seo-feature-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin: 0; }

.seo-howto-list { list-style: decimal; padding-left: 20px; color: var(--text-muted); line-height: 1.8; font-size: 0.95rem; }
.seo-howto-list li { margin-bottom: 10px; }
.seo-howto-list strong { color: var(--text-main); }

[data-theme="dark"] .tool-seo-content { background: var(--bg-surface); }
[data-theme="dark"] .seo-feature-card { background: #0f172a; border-color: #334155; }

/* =========================================================
   移动端完美流式响应
   ========================================================= */
@media (max-width: 900px) {
    .seo-feature-grid-3 { grid-template-columns: 1fr; gap: 16px; }

    .bc-workspace { 
        flex-direction: column; 
        gap: 20px; 
    }
    
    .bc-sidebar-fixed { 
        position: relative !important; 
        top: 0 !important; 
        width: 100% !important; 
        max-height: none !important; 
        overflow-y: visible !important; 
        border-radius: var(--radius-lg) !important;
        margin-bottom: 10px;
    }
    
    .bc-canvas-scroll { 
        width: 100%; 
        padding: 20px 0 0 0; /* 移动端取消左右 padding，释放最大宽度 */
        border: none;
        background: transparent; 
        overflow: hidden; 
    }
}