/* 基础容器样式 */
.oak-ticket-view-container-wrapper {
    max-width: 1800px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
    transition: all 0.3s ease;
}

.oak-ticket-view-container-wrapper:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* 页面标题 */
.oak-ticket-view-page-title {
    text-align: center;
    margin-bottom: 24px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: #1f2937;
    font-weight: 600;
    letter-spacing: -0.025em;
}

/* 用户提示框 */
.oak-ticket-view-tickets-alert {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

/* 分栏布局容器 */
.oak-ticket-view-layout-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* 左侧主内容区 */
.oak-ticket-view-main-content {
    flex: 1 1 70%; /* 左侧占70%宽度 */
}

/* 右侧历史工单侧边栏 */
.oak-ticket-view-history-sidebar {
    flex: 1 1 30%; /* 右侧占30%宽度 */
}

/* 区域标题（我的工单/历史工单） */
.oak-ticket-view-section-title {
    margin-bottom: 16px;
    font-size: 1.25rem;
    color: #1f2937;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #2655ff;
}

/* 工单统计数据容器 - 保持两个div并排 */
.oak-ticket-view-stats-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

/* 单个统计项 - 确保内部文字和数字同行 */
.oak-ticket-view-stat-item {
    flex: 1;
    background: #f8fafc;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e2e8f0;
    display: flex; /* 关键：启用flex布局 */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
    gap: 8px; /* 标签和数值之间的间距 */
    white-space: nowrap; /* 防止换行 */
}

/* 统计标签 */
.oak-ticket-view-stat-label {
    font-size: 0.875rem;
    color: #64748b;
}

/* 统计数值 */
.oak-ticket-view-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2655ff;
}

/* 搜索表单样式（保持原有） */
.oak-ticket-view-custom-search-form {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 12px;
    align-items: center;
}

.oak-ticket-view-custom-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    height: 48px;
    min-height: 48px;
    box-sizing: border-box;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    font-size: 1rem;
}

.oak-ticket-view-custom-search-input:focus {
    outline: none;
    border-color: #2655ff;
    box-shadow: 0 0 0 3px rgba(0, 47, 167, 0.15);
}

.oak-ticket-view-custom-ticket-search {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2655ff, #0040c0);
    color: #ffffff;
    cursor: pointer;
    height: 48px;
    min-height: 48px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 47, 167, 0.1);
    white-space: nowrap;
}

/* 表格样式 */
.oak-ticket-view-table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.oak-ticket-view-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.oak-ticket-view-table th,
.oak-ticket-view-table td {
    padding: 16px;
    vertical-align: middle;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.oak-ticket-view-table thead th {
    vertical-align: bottom;
    background: #2655ff;
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* 工单内容样式 */
.oak-ticket-view-ticket-content {
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 16px;
    transition: all 0.2s ease;
}

/* 进度条样式 */
.oak-ticket-view-progress {
    display: flex;
    background: #f3f4f6;
    border-radius: 9999px;
    height: 24px;
    width: 100%;
    margin-top: 16px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.oak-ticket-view-status-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
    width: 100%;
}

.oak-ticket-view-status-item {
    flex: 1;
    text-align: center;
    padding: 4px;
    color: #6b7280;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.oak-ticket-view-status-item.oak-ticket-view-active {
    color: #2655ff;
    font-weight: 600;
    background: rgba(0, 47, 167, 0.1);
}

/* 提示框样式 */
.oak-ticket-view-alert {
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
    border-radius: 8px;
    font-weight: 500;
}

.oak-ticket-view-alert-info {
    color: #b3b3b3;
    background: #ffffff;
}

/* 分页样式 */
.oak-ticket-view-pagination {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
}

.oak-ticket-view-pagination ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
}

.oak-ticket-view-pagination a,
.oak-ticket-view-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    color: #2655ff;
    text-decoration: none;
    background: transparent;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 47, 167, 0.1);
}

.oak-ticket-view-pagination .current {
    background: #2655ff;
    color: white;
    border-color: #2655ff;
}

/* 右侧历史工单样式 */
.oak-ticket-view-history-link {
    color: #2655ff;
    text-decoration: none;
}

.oak-ticket-view-history-link:hover {
    color: #0035b3;
    text-decoration: underline;
}

.oak-ticket-view-history-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 历史工单表格容器 - 核心：添加垂直滚动条 */
.oak-ticket-view-history-table-container {
    overflow-y: auto; /* 超出高度时显示垂直滚动条 */
    overflow-x: hidden; /* 隐藏水平滚动 */
}

/* 历史工单分页 */
.oak-ticket-view-history-pagination {
    margin-top: 16px;
}

/* 历史工单状态颜色区分 */
.oak-ticket-view-history-status-已分派 {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.oak-ticket-view-history-status-处理中 {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.oak-ticket-view-history-status-待确认 {
    background: rgba(14, 165, 233, 0.1);
    color: #0284c7;
}

.oak-ticket-view-history-status-已解决 {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.oak-ticket-view-history-status-已关闭 {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* 手机端响应式修复 */
@media (max-width: 768px) {
    .oak-ticket-view-container-wrapper {
        padding: 16px;
        margin: 12px;
        width: calc(100% - 24px); /* 关键：确保容器不超出屏幕 */
        box-sizing: border-box;
    }

    /* 分栏改为上下排列，避免横向挤压 */
    .oak-ticket-view-layout-container {
        flex-direction: column;
        gap: 24px;
    }

    .oak-ticket-view-main-content,
    .oak-ticket-view-history-sidebar {
        flex: 1 1 100%; /* 手机端占满宽度 */
        width: 100%;
        box-sizing: border-box;
    }

    /* 搜索表单保持左右排列 */
    .oak-ticket-view-custom-search-form {
        flex-direction: row;
        gap: 8px;
        width: 100%;
    }

    .oak-ticket-view-custom-search-input {
        flex: 1;
        font-size: 0.875rem;
    }

    .oak-ticket-view-custom-ticket-search {
        flex: 0 0 80px; /* 按钮固定窄宽度 */
    }

    /* 手机端历史工单表格高度调整 */
    .oak-ticket-view-history-table-container {
        max-height: 280px;
    }

    /* 表格内容适配小屏幕 */
    .oak-ticket-view-table th,
    .oak-ticket-view-table td {
        padding: 10px 6px;
        font-size: 0.8rem;
    }
    
    /* 统计数据在手机端的样式 */
    .oak-ticket-view-stat-item {
        font-size: 0.8rem;
    }
    
    .oak-ticket-view-stat-value {
        font-size: 1rem;
    }
}