* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.video-container {
    width: 100%;
    padding: 20px;
}

.video-container video {
    width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

.container {
    display: flex;
    height: 100vh;
    padding: 20px;
    gap: 20px;
    overflow: hidden;
}

.input-panel {
    width: 35%;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.output-panel {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

h2 {
    margin-bottom: 20px;
    color: #333;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    /* margin-bottom: 15px; */
}

.control-panel {
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    flex-direction: column;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-item label {
    white-space: nowrap;
}

.control-item input[type="number"] {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.control-item select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 80px;
}

button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
    transition: all 0.3s ease;
}

.tab:hover {
    background-color: #f5f5f5;
}

.tab.active {
    background-color: #4CAF50;
    color: white;
    border-bottom: 2px solid #388E3C;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.progress {
    margin-top: 15px;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 4px;
}

.image-container {
    width: 100%;
    text-align: center;
}

.image-container img {
    max-width: 100%;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.3s;
}

.image-container img:hover {
    transform: scale(1.02);
}

.placeholder {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 4px;
    color: #666;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.modal-nav {
    position: absolute;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 0;
}

.nav-btn {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    margin: 0 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.image-counter {
    color: white;
    font-size: 16px;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
}

.image-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.image-item:hover {
    transform: scale(1.02);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.modal img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

/* 历史面板样式 */
.history-panel {
    position: fixed;
    top: 0;
    right: -25%;
    width: 25%;
    height: 100%;
    background-color: #f8f9fa;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
    z-index: 100;
    padding: 10px;
}

.history-panel.show {
    right: 0;
}

.history-toggle-btn {
    margin-left: 10px;
    padding: 5px 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
}

.history-item {
    position: relative;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.history-images-scroll {
    width: 100%;
    overflow-x: auto;
    padding: 10px;
}

.history-images {
    display: flex;
    gap: 5px;
    min-width: 100%;
}

.history-images img {
    width: 45%;
    height: 140px;
    object-fit: cover;
    border-radius: 4px;
}

.more-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 80px;
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
    border-radius: 4px;
    font-weight: bold;
}

.history-info {
    padding: 10px;
    border-top: 1px solid #eee;
}

.history-prompt {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 5px;
    word-break: break-word;
}

.history-type {
    font-size: 0.8rem;
    color: #666;
}

/* 调整主容器以适应历史面板 */
.container {
    transition: margin-right 0.3s ease;
}

.container.history-visible {
    margin-right: 15%;
}

.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #ff4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.delete-btn:hover {
    background-color: #ff4444;
    color: white;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
}

.history-time {
    color: #888;
}

.upload-button {
    display: inline-block;
    padding: 6px 12px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.upload-button:hover {
    background-color: #45a049;
}

.upload-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.image-preview {
    margin-left: 10px;
    position: relative;
}

.image-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.upload-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    text-align: center;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.radio-group {
    display: flex;
    margin: 10px 0;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-label input {
    margin-right: 5px;
}

.radio-label span {
    font-size: 16px;
}

/* 开关按钮样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.toggle-label {
    background-color: #4CAF50;
}

input:checked+.toggle-label:before {
    transform: translateX(26px);
}

/* 移动端优化样式 */
@media (max-width: 768px) {

    /* 确保移动端容器不会溢出 */
    .container {
        padding: 10px;
        gap: 10px;
    }

    /* 移动端任务管理布局优化 - 确保任务列表占用至少60%空间 */
    .admin-container {
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    /* 移动端头部紧凑化 - 最多占35%高度 */
    .admin-header {
        flex-shrink: 0;
        max-height: 35vh;
        overflow: visible;
    }

    /* 移动端任务列表至少占60%高度 */
    .admin-task-list {
        flex: 1;
        min-height: 60vh;
        display: flex;
        flex-direction: column;
    }

    /* 移动端筛选条件折叠动画 */
    .mobile-filters-enter-active,
    .mobile-filters-leave-active {
        transition: all 0.3s ease;
        max-height: 300px;
        overflow: hidden;
    }

    .mobile-filters-enter-from,
    .mobile-filters-leave-to {
        max-height: 0;
        opacity: 0;
    }

    /* 优化移动端表单输入框 */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    select {
        min-height: 44px;
        /* 符合移动端触摸标准 */
        font-size: 16px;
        /* 防止iOS缩放 */
    }

    /* 优化移动端按钮 */
    /* button {
        min-height: 44px;
        font-size: 14px;
    } */

    /* 移动端弹窗优化 */
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }

    /* 移动端滚动区域优化 */
    .overflow-y-auto {
        -webkit-overflow-scrolling: touch;
    }

    /* 移动端文本截断优化 */
    .truncate {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 移动端任务卡片优化 */
    .mobile-task-card {
        background: #f9fafb;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 8px;
    }

    /* 移动端分页固定在底部 */
    .mobile-pagination {
        position: sticky;
        bottom: 0;
        background: white;
        border-top: 1px solid #e5e7eb;
        z-index: 10;
    }
}
}

/* 响应式网格优化 */
@media (max-width: 640px) {

    /* 统计卡片在小屏幕上的优化 */
    .grid-cols-2>div {
        min-height: 80px;
    }

    /* 表格在移动端隐藏，使用卡片视图 */
    .hidden.md\\:block {
        display: none !important;
    }

    .block.md\\:hidden {
        display: block !important;
    }
}

/* 触摸友好的交互元素 */
@media (hover: none) and (pointer: coarse) {
    button:hover {
        transform: none;
    }

    .hover\\:bg-gray-50:hover {
        background-color: rgb(249 250 251);
    }

    .hover\\:bg-secondary:hover {
        background-color: var(--secondary-color, #4338ca);
    }
}
