/* 自定义样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.form-control {
    border-radius: 0.375rem;
}

.alert {
    border-radius: 0.375rem;
}

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

/* 菜谱卡片样式 */
.recipe-preview {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

/* 表格样式 */
.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
}

.table td {
    vertical-align: middle;
}

/* 加载动画 */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* 自定义按钮样式 */
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-success {
    background-color: #198754;
    border-color: #198754;
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

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

.modal-header {
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
}

/* 页脚样式 */
footer {
    margin-top: auto;
}

/* 导航栏样式 */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 1);
}

/* 表单验证样式 */
.is-invalid {
    border-color: #dc3545;
}

.is-valid {
    border-color: #198754;
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

/* 进度条样式 */
.progress {
    height: 0.5rem;
    border-radius: 0.25rem;
}

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

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

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

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

/* 任务状态页面样式 */
.task-card {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.15);
}

.task-card.completed {
    border-left: 4px solid #198754;
}

.task-card.failed {
    border-left: 4px solid #dc3545;
}

.task-card.pending {
    border-left: 4px solid #ffc107;
}

.task-card.processing {
    border-left: 4px solid #0dcaf0;
}

.task-status .badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
}

.task-meta {
    border-top: 1px solid #e9ecef;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.task-meta i {
    margin-right: 0.25rem;
    width: 1rem;
    color: #6c757d;
}

/* 菜谱详情页面样式 */
.recipe-detail {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.recipe-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1rem;
}

.recipe-header h1 {
    color: #212529;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.recipe-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.recipe-source {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border-left: 3px solid #0d6efd;
}

.ingredients-section {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
}

.ingredients-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ingredients-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
    position: relative;
    padding-left: 1.5rem;
}

.ingredients-list li:before {
    content: "•";
    color: #0d6efd;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.ingredients-list li:last-child {
    border-bottom: none;
}

.steps-section {
    margin-top: 2rem;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
}

.step-number {
    background-color: #0d6efd;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-tip {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.media-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.media-item {
    text-align: center;
}

.media-item img {
    border-radius: 0.375rem;
    transition: transform 0.3s ease;
}

.media-item img:hover {
    transform: scale(1.05);
}

.media-caption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.raw-content {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
}

.pre-scrollable {
    max-height: 400px;
    overflow-y: auto;
}

/* 状态徽章样式增强 */
.badge-warning {
    background-color: #ffc107;
    color: #000;
}

.badge-info {
    background-color: #0dcaf0;
    color: #000;
}

.badge-success {
    background-color: #198754;
}

.badge-danger {
    background-color: #dc3545;
}

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

.breadcrumb-item a {
    color: #0d6efd;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .recipe-detail {
        padding: 1rem;
    }
    
    .recipe-header h1 {
        font-size: 1.5rem;
    }
    
    .recipe-meta {
        gap: 0.5rem;
    }
    
    .step-item {
        flex-direction: column;
        text-align: center;
    }
    
    .media-gallery .col-md-4 {
        margin-bottom: 1rem;
    }
    
    .task-card {
        margin-bottom: 1rem;
    }
}

/* 加载状态样式 */
.spinner-border-lg {
    width: 3rem;
    height: 3rem;
}

/* 消息提示样式 */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1055;
    min-width: 300px;
}

.message-toast .toast-body {
    padding: 1rem;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* 工具按钮样式 */
.action-buttons {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.task-card:hover .action-buttons {
    opacity: 1;
}

.action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* 内容折叠样式 */
.content-collapse {
    max-height: 300px;
    overflow: hidden;
    position: relative;
}

.content-collapse:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent, rgba(248, 249, 250, 0.95));
    pointer-events: none;
}

.show-more-btn {
    margin-top: 1rem;
    text-align: center;
}
