/* 脚本管理系统自定义样式 */

/* 基础样式 */
body {
    background-color: #ffffff;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.container-fluid {
    max-width: 1400px;
}

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

/* 卡片样式 */
.card {
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.card-header {
    border-radius: 16px 16px 0 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(248, 249, 250, 0.8);
}

/* 脚本卡片特殊样式 */
.script-card {
    transition: all 0.3s ease;
}

.script-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.script-card .card-header {
    background: rgba(248, 249, 250, 0.9);
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    animation: pulse 2s infinite;
}

.status-badge.bg-success {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    animation: none;
}

.status-badge.bg-secondary {
    background: linear-gradient(135deg, #6c757d, #adb5bd) !important;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 8px 0 0 8px;
}

.btn-group .btn:last-child {
    border-radius: 0 8px 8px 0;
}

.btn-group .btn:only-child {
    border-radius: 8px;
}

/* 响应式按钮组 */
@media (max-width: 576px) {
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 8px !important;
        margin-bottom: 2px;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

/* 统计信息样式 */
.text-center .h4 {
    font-weight: 700;
    font-size: 2rem;
}

/* 面包屑样式 */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2em;
    color: #6c757d;
}

/* 配置表单样式 */
.config-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #007bff;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* 日志容器样式 */
.log-container {
    height: 45vh;
    min-height: 400px;
    overflow-y: auto;
    background-color: #ffffff;
    color: #333333;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    scrollbar-width: thin;
    scrollbar-color: #6c757d #ffffff;
}

.log-container::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track {
    background: #ffffff;
}

.log-container::-webkit-scrollbar-thumb {
    background: #6c757d;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.log-line {
    padding: 2px 0;
    line-height: 1.4;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
    white-space: pre-wrap;
}

.log-line:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 日志颜色高亮 */
.log-line:contains("ERROR") {
    color: #f48771;
}

.log-line:contains("WARNING") {
    color: #dcdcaa;
}

.log-line:contains("INFO") {
    color: #9cdcfe;
}

.log-line:contains("SUCCESS") {
    color: #b5cea8;
}

/* Toast样式 */
.toast {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-body {
    font-weight: 500;
}

/* 模态框样式 */
.modal-content {
    border-radius: 16px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px 16px 0 0;
    background: rgba(248, 249, 250, 0.8);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0 0 16px 16px;
    background: rgba(248, 249, 250, 0.8);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .log-container {
        height: 300px;
        font-size: 0.75rem;
    }
    
    .text-center .h4 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .log-container {
        height: 250px;
        padding: 0.5rem;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    .card {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }
    
    .card-header {
        background-color: #2d2d2d !important;
        border-bottom-color: #404040;
    }
    
    .form-control, .form-select {
        background-color: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    .form-control:focus, .form-select:focus {
        background-color: #2d2d2d;
        border-color: #0d6efd;
        color: #e0e0e0;
    }
    
    .modal-content {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }
    
    .modal-header, .modal-footer {
        border-color: #404040;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 工具提示样式 */
.tooltip-inner {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-radius: 6px;
    font-size: 0.875rem;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #1e1e1e;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #1e1e1e;
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #1e1e1e;
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #1e1e1e;
}

/* 状态指示器 */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-indicator.running {
    background-color: #28a745;
    animation: blink 1.5s infinite;
}

.status-indicator.stopped {
    background-color: #6c757d;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

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

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

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

/* 筛选按钮样式 - 紧凑模式 */
.filter-tag {
    background: transparent !important;
    border: none !important;
    padding: 2px 8px !important;
    font-size: 13px !important;
    color: #fff !important;
    border-radius: 0 !important;
    position: relative;
}

.filter-tag:not(:last-child)::after {
    content: '|';
    position: absolute;
    right: -2px;
    color: #666;
}

.filter-tag:hover {
    background: transparent !important;
    color: #667eea !important;
    transform: none !important;
    border: none !important;
}

.filter-tag.active {
    background: transparent !important;
    border: none !important;
    color: #667eea !important;
    font-weight: 600;
    box-shadow: none !important;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0px !important;
    line-height: 1.8;
}

/* 演员信息 - 横向滑动样式 */
.people-scroll-container {
    position: relative;
    margin-top: 10px;
    max-width: 100%;
    overflow: hidden;
}

.people-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    padding: 5px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.people-scroll::-webkit-scrollbar {
    height: 4px;
}

.people-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.people-scroll::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 2px;
}

.person-card {
    flex: 0 0 80px;
    text-align: center;
    transition: transform 0.2s;
}

.person-card:hover {
    transform: scale(1.05);
}

.person-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 6px;
}

.person-name {
    font-size: 11px;
    color: #333;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.person-role {
    font-size: 10px;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

/* 导演信息 - 横向滑动样式 */
.crew-scroll-container {
    position: relative;
    margin-top: 10px;
    max-width: 100%;
    overflow: hidden;
}

.crew-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 10px;
    padding: 5px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.crew-scroll::-webkit-scrollbar {
    height: 4px;
}

.crew-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.crew-scroll::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 2px;
}

.crew-name-tag {
    flex: 0 0 auto;
    padding: 5px 12px;
    background: transparent;
    border: 1px solid rgba(102, 126, 234, 0.5);
    border-radius: 15px;
    color: #333;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
}

.crew-name-tag:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 深色模式下的演员和导演样式 */
@media (prefers-color-scheme: dark) {
    .person-avatar {
        background: rgba(0, 0, 0, 0.5);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .person-name {
        color: #e0e0e0;
    }
    
    .person-role {
        color: #aaa;
    }
    
    .crew-name-tag {
        color: #fff;
        background: transparent;
        border-color: rgba(102, 126, 234, 0.6);
    }
    
    .crew-name-tag:hover {
        background: rgba(102, 126, 234, 0.2);
        border-color: #667eea;
}

/* 设备规则管理按钮样式 */
.device-rule-actions {
    display: flex;
    gap: 4px;
}

.device-rule-toggle-btn,
.device-rule-delete-btn {
    min-width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

@media (max-width: 768px) {
    .device-rule-toggle-btn,
    .device-rule-delete-btn {
        min-width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* 深色模式下的设备规则按钮样式 */
@media (prefers-color-scheme: dark) {
    .people-scroll::-webkit-scrollbar-track,
    .crew-scroll::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
    }
}
