/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: bold;
}

/* 脚本预览样式 */
.script-preview {
    max-height: 80px;
    overflow: hidden;
    line-height: 1.5;
    font-size: 14px;
    color: #6c757d;
}

/* 幻灯片编辑样式 */
.slide-item {
    border-left: 4px solid #B81D26;
    transition: all 0.3s ease;
}

.slide-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 要点显示样式 */
.key-point {
    background-color: transparent;
    border: none;
    padding: 0;
    margin-bottom: 15px;
    position: relative;
    padding-left: 20px;
}

.key-point:last-child {
    margin-bottom: 0;
}

.key-point::before {
    content: "●";
    position: absolute;
    left: 0;
    top: 0;
    color: white;
    font-size: 12px;
    line-height: 1.6;
}

.point-marker {
    display: block;
}

.point-marker .badge {
    display: none;
}

.point-content {
    line-height: 1.6;
    color: white;
}

.content-preview .key-point {
    border: none;
    padding: 12px 0;
    margin-bottom: 12px;
    background-color: transparent;
}

.content-preview .key-point:not(:last-child) {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.image-preview {
    text-align: center;
    padding: 10px;
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: cover;
}

/* 苹果风格的选择框样式 */
.crop-selection-box {
    position: absolute;
    border: 2px dashed #B81D26;
    background-color: rgba(184, 29, 38, 0.1);
    z-index: 1000;
    pointer-events: none;
    border-radius: 2px;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.8),
        0 2px 8px rgba(184, 29, 38, 0.3);
    animation: selection-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes selection-pulse {
    0% {
        border-color: #B81D26;
        background-color: rgba(184, 29, 38, 0.1);
    }
    100% {
        border-color: #8f1620;
        background-color: rgba(184, 29, 38, 0.2);
    }
}

.crop-selection-box::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    pointer-events: none;
}

/* 视频预览样式 */
.video-preview-container {
    max-width: 400px;
    margin: 0 auto;
}

.video-mockup {
    position: relative;
    width: 240px;
    height: 427px; /* 240 * 16/9 = 427 for perfect 9:16 ratio */
    margin: 0 auto;
    border: 3px solid #333;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
}

.video-frame {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    display: flex;
    flex-direction: column;
}

/* Progress section - 进度标签和进度条 */
.progress-section {
    position: absolute;
    top: 80px; /* Logo下方紧贴 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 85%;
    max-width: 200px; /* Reduced for mobile frame */
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-label {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 10px; /* Smaller for mobile frame */
    color: #FFFFFF;
    text-align: center;
    flex: 1;
    font-weight: normal;
}

.progress-bars {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.progress-bar-segment {
    flex: 1;
    height: 4px;
    background: #CCCCCC;
    border-radius: 2px;
}

.progress-bar-segment.active {
    background: #B81D26;
}

/* Legacy progress bar - hidden for new design */
.progress-bar-preview {
    display: none;
}

.progress-fill {
    height: 100%;
    background: #ef4444;
    transition: width 0.3s ease;
}

/* Category tag - 分类徽标 */
.tag-preview {
    position: absolute;
    top: 120px; /* Progress section 下方调整 */
    left: 15px;
    background: #B81D26;
    color: #FFFFFF;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px; /* Smaller for mobile frame */
    font-weight: bold;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    z-index: 10;
}

.content-area {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.slide-image {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.2);
    color: white;
    padding: 60px 15px 15px;
    font-size: 12px;
    line-height: 1.6;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Title slide specific styles - 主标题 */
.slide-text.title-slide {
    font-size: 18px; /* Much smaller for mobile frame */
    font-weight: bold;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #FFFFFF;
    text-align: center;
    line-height: 1.3;
    padding: 160px 20px 60px; /* Adjusted for mobile frame */
    width: 90%;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* Logo styles - 品牌Logo规范 */
.logo-container {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
}

.logo-image {
    height: 32px; /* Smaller for mobile frame */
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* Brand text logo if using text instead of image */
.brand-logo {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    color: #FFFFFF;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.brand-logo .chinese {
    font-size: 48px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 4px;
}

.brand-logo .english {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    letter-spacing: 2px;
}

.brand-logo .english .red-d {
    color: #B81D26;
}

/* Animation keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideTransition {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

/* Text animation */
.slide-text {
    animation: fadeIn 0.8s ease-out;
}

.slide-text.title-slide {
    animation: fadeIn 1.2s ease-out;
}

/* Slide transition */
.video-frame {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.video-controls {
    text-align: center;
}

.slide-info {
    font-weight: bold;
    color: #495057;
}

/* 幻灯片列表样式 */
.slide-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.slide-row:hover {
    background-color: #f8f9fa;
}

.slide-row.table-active {
    background-color: #fde8e6;
}

.slide-text-preview {
    font-size: 14px;
    line-height: 1.4;
}

/* 按钮样式 */
.btn {
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 0.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

/* 表格样式 */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
}

/* 徽章样式 */
.badge {
    font-size: 0.75em;
    padding: 0.375em 0.75em;
}

/* 表单样式 */
.form-control:focus {
    border-color: #B81D26;
    box-shadow: 0 0 0 0.2rem rgba(184,29,38,0.25);
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 警告框样式 */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* 模态框样式 */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .video-mockup {
        width: 200px;
        height: 356px;
    }
    
    .slide-text {
        font-size: 10px;
        padding: 15px 8px 8px;
    }
    
    .tag-preview {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* 加载动画 */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* 文件上传样式 */
.form-control[type="file"] {
    padding: 0.375rem 0.75rem;
}

/* 图标样式 */
.fas, .far {
    margin-right: 0.25rem;
}

/* 链接样式 */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 🚨 改进的裁剪界面样式 - 去掉模糊，使用清晰虚线框 */
.crop-image-container {
    position: relative;
    display: inline-block;
    user-select: none;
}

.crop-image-container img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 清晰的虚线选择框 - 不模糊背景 */
.crop-selection-overlay {
    position: absolute;
    border: 3px dashed #B81D26;
    background: rgba(184, 29, 38, 0.08);
    border-radius: 4px;
    cursor: move;
    z-index: 10;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.9),
        0 4px 12px rgba(184, 29, 38, 0.25);
    transition: all 0.2s ease;
}

.crop-selection-overlay:hover {
    border-color: #8f1620;
    background: rgba(184, 29, 38, 0.12);
    box-shadow: 
        0 0 0 2px rgba(255, 255, 255, 0.9),
        0 6px 16px rgba(184, 29, 38, 0.35);
}

/* 8方向拖拽控制点 */
.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #B81D26;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 15;
    transition: all 0.2s ease;
}

.crop-handle:hover {
    transform: scale(1.3);
    background: #8f1620;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

/* 控制点悬停放大效果 */
.crop-handle.n:hover { transform: translateX(-50%) scale(1.3); }
.crop-handle.s:hover { transform: translateX(-50%) scale(1.3); }
.crop-handle.w:hover { transform: translateY(-50%) scale(1.3); }
.crop-handle.e:hover { transform: translateY(-50%) scale(1.3); }

/* 控制点位置 */
.crop-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
.crop-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
.crop-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.crop-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }
.crop-handle.n { top: -6px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.crop-handle.s { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.crop-handle.w { top: 50%; left: -6px; transform: translateY(-50%); cursor: w-resize; }
.crop-handle.e { top: 50%; right: -6px; transform: translateY(-50%); cursor: e-resize; }

/* 实时尺寸显示 */
.crop-size-indicator {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #B81D26;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 20;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* 裁剪工具状态提示 */
.crop-status-tip {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    margin: 10px 0;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 20px;
    border: 1px solid #e9ecef;
}

/* ===== 品牌配色：黑 + 红（覆盖 Bootstrap 默认蓝色主色调）===== */
:root{
    --bs-primary:#B81D26;
    --bs-primary-rgb:184,29,38;
    --brand-red:#B81D26;
    --brand-red-dark:#8f1620;
    --brand-ink:#1a1a1a;
    --bs-link-color:#B81D26;
    --bs-link-hover-color:#8f1620;
}
/* 导航栏：白底配 Logo */
.navbar.bg-primary{
    background-color:#ffffff!important;
    border-bottom:1px solid #ececec;
    box-shadow:0 1px 4px rgba(0,0,0,.05);
}
.navbar.navbar-dark .navbar-brand,
.navbar.navbar-dark .nav-link{color:var(--brand-ink)!important;}
.navbar .nav-link:hover{color:var(--brand-red)!important;}
.navbar-brand img{height:46px;width:auto;display:block;}
.navbar.navbar-dark .navbar-toggler-icon{filter:invert(1) grayscale(1);}
/* 主按钮：红色 */
.btn-primary{background-color:var(--brand-red);border-color:var(--brand-red);}
.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,
.btn-primary:not(:disabled):not(.disabled):active{
    background-color:var(--brand-red-dark)!important;
    border-color:var(--brand-red-dark)!important;
    box-shadow:none;
}
.btn-outline-primary{color:var(--brand-red);border-color:var(--brand-red);}
.btn-outline-primary:hover,.btn-outline-primary:active{background-color:var(--brand-red)!important;border-color:var(--brand-red)!important;color:#fff!important;}
/* 文本/背景/边框主色 */
.text-primary{color:var(--brand-red)!important;}
.bg-primary:not(.navbar){background-color:var(--brand-red)!important;}
.badge.bg-primary{background-color:var(--brand-red)!important;}
.border-primary{border-color:var(--brand-red)!important;}
/* 链接、表单聚焦、选择控件 */
a{color:var(--brand-red);}
a:hover{color:var(--brand-red-dark);}
.navbar.navbar-dark .navbar-brand:hover{color:var(--brand-ink)!important;}
.form-control:focus,.form-select:focus{border-color:var(--brand-red);box-shadow:0 0 0 .2rem rgba(184,29,38,.2);}
.form-check-input:checked{background-color:var(--brand-red);border-color:var(--brand-red);}
.nav-pills .nav-link.active{background-color:var(--brand-red);}
.slide-item{border-left-color:var(--brand-red);}
/* 进度/加载色 */
.spinner-border.text-primary{color:var(--brand-red)!important;}

/* info 蓝青色 → 品牌红（徽章、提示框、图标）*/
:root{ --bs-info-rgb:184,29,38; --bs-info:#B81D26; }
.text-info{color:var(--brand-red)!important;}
.alert-info{background-color:#fdeceb;border-color:#f7c9c4;color:#8a1c10;}

/* ===== 平台账号区（精致现代风，分层：平台名=灰标签 / 账号=中性chip / 状态=圆点+tint）===== */
.platforms-card{ border-radius:16px; box-shadow:0 2px 12px rgba(20,30,50,.05); border:1px solid #e9edf3; }
.platform-badges{ display:flex; flex-wrap:wrap; gap:12px 26px; align-items:center; }
.badge-group{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.badge-group .platform-name{ display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600; color:#6b7686; letter-spacing:.02em; }
.badge-group .platform-name i{ font-size:13px; }
.account-chip{
    display:inline-flex; align-items:center; gap:6px;
    padding:4px 9px 4px 8px; border-radius:999px;
    font-size:12px; font-weight:600; color:#1f2530;
    background:#fff; border:1px solid #e6eaf1;
    cursor:pointer; transition: box-shadow .15s, border-color .15s;
}
.account-chip:hover{ box-shadow:0 3px 10px rgba(20,30,50,.1); border-color:#cdd4e0; }
.account-chip.chip-on{ background:#e8f7ee; border-color:#a9dcbd; }
.account-chip.chip-exp{ background:#fef3e0; border-color:#eccb93; }
.account-chip.chip-off{ background:#f2f4f7; border-color:#dbe1e9; color:#6b7686; cursor:default; }
.account-chip .status-dot{ width:10px; height:10px; border-radius:50%; display:inline-block; flex:none; }
.account-chip .chip-status{ font-weight:600; }
.account-chip.chip-on .chip-status{ color:#1c8a4b; }
.account-chip.chip-exp .chip-status{ color:#d97a06; }
.account-chip.chip-off .chip-status{ color:#8a93a3; }
.account-chip .chip-del{ width:15px; height:15px; line-height:14px; text-align:center; border-radius:50%; background:rgba(220,53,69,.08); color:#dc3545; font-size:12px; margin-left:2px; flex:none; opacity:.8; }
.account-chip .chip-del:hover{ opacity:1; background:rgba(220,53,69,.16); }
.chip-add{
    display:inline-flex; align-items:center; justify-content:center;
    width:22px; height:22px; border-radius:50%;
    font-size:11px; color:#8a93a3; background:transparent;
    border:1px dashed #c3ccd8; cursor:pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.chip-add:hover{ background:#f2f3f6; color:#5b6472; border-color:#a9b4c3; }
